#include #include #include #include #include #define LIMIT 50 /************************ * Function Declarations ************************/ void signal_handler(int sig); /* Default OPAL crs self callback functions */ int opal_crs_self_user_checkpoint(char **restart_cmd); int opal_crs_self_user_continue(void); int opal_crs_self_user_restart(void); /* OPAL crs self callback functions */ int my_personal_checkpoint(char **restart_cmd); int my_personal_continue(void); int my_personal_restart(void); /******************* * Global Variables and arrays *******************/ int myrank, numprocs; double *a, *b, *c, *d; int am_done = 1; const int N=1000000; // Defines size of arrays int inr_loop_counter = 0; int out_loop_counter = 0; int current_step = 0; char ckpt_file[128]; char restart_path[128] = "my-restart-path../SELF_CR"; int main(int argc, char** argv){ MPI_Init(&argc, &argv); int input_time; if( argc != 2 ) { input_time = 200; } else{ input_time = atoi(argv[1]); } /* So we can exit cleanly */ signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); // printf("Received Signal \n"); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); MPI_Status status[4]; MPI_Request request[4]; a = (double *) malloc( N*sizeof(double) ); b = (double *) malloc( N*sizeof(double) ); c = (double *) malloc( N*sizeof(double) ); d = (double *) malloc( N*sizeof(double) ); int i=0; for(i=0; i