Hi Brandon,
    dmtcpaware2.c is the old interface.  I would recommend looking
at the newer alternative:
  <DMTCP>/test/plugin/
some subdirectories there to look especially at are:
  applic-delayed-ckpt
  applic-initiated-ckpt

I would recommend trying that first.
Best,
- Gene


On Fri, May 29, 2015 at 07:08:05PM -0400, Brandon Barker wrote:
> Hi All,
> 
> I must be doing something silly: when I try to run the following program,
> based very closely on dmtcpaware2.c,
> it always reports that dmtcp is not enabled (whether or not I run it with
> dmtcp_launch).
> 
> In summary:
> dmtcp_aware2.c, with dmtcp_launch:       reports dmtcp is enabled
> dmtcp_aware2.c, without dmtcp_launch:    reports dmtcp NOT enabled
> count_aware.c,  with dmtcp_launch:       reports dmtcp NOT enabled
> count_aware.c,  without dmtcp_launch:    reports dmtcp NOT enabled
> 
> ---- code below ----
> 
> #include <stdlib.h>
> #include <assert.h>
> #include <stdio.h>
> 
> /* Be sure to compile with -I<path>; see Makefile in this directory. */
> #include "dmtcp.h"
> 
> #define INTS_PER_LOOP 3
> 
> // Prints a sequence of n integers starting at 0
> // at a rate of 1 character integer second, then checkpoints
> 
> int main(int argc, char* argv[])
> {
>   unsigned long ii = 0;
>   int count = 0;
>   int rr;
>   int numCheckpoints, numRestarts;
>   while (1)
>   {
>     if(dmtcp_is_enabled()){
>       dmtcp_get_local_status(&numCheckpoints, &numRestarts);
>       printf("on iteration %d: this process has checkpointed %d times
> and restarted %d times\n",
>              ++count, numCheckpoints, numRestarts);
>     }else{
>       printf("on iteration %d; DMTCP not enabled!\n", ++count);
>     }
>     do {
>       printf("%d ", ii);
>       fflush(stdout);
>       sleep(1);
>       ii++;
>     } while (ii % INTS_PER_LOOP != 0);
>     printf("\n");
>     // Checkpoint and print result
>     if(dmtcp_is_enabled()){
>       printf("\n");
>       rr = dmtcp_checkpoint();
>       if(rr <= 0)
>       printf("Error, checkpointing failed: %d\n",rr);
>       if(rr == 1)
>       printf("***** after checkpoint *****\n");
>       if(rr == 2)
>       printf("***** after restart *****\n");
>     }else{
>       printf(" dmtcp disabled -- nevermind\n");
>     }
> 
>   }
>   return 0;
> }
> 
> 
> 
> --- simple makefile ---
> 
> ifndef CC CC=icc endif count_aware: count_aware.c ${CC} ${CFLAGS} -I
> ${DMTCP_ROOT}/include -o count_aware count_aware.c
> 
> 
> 
> Thanks,
> 
> -- 
> Brandon E. Barker
> http://www.cac.cornell.edu/barker/

> ------------------------------------------------------------------------------

> _______________________________________________
> Dmtcp-forum mailing list
> Dmtcp-forum@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dmtcp-forum


------------------------------------------------------------------------------
_______________________________________________
Dmtcp-forum mailing list
Dmtcp-forum@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dmtcp-forum

Reply via email to