diff --git a/include/fti-defs.h b/include/fti-defs.h new file mode 100644 index 000000000..2dcdd15ce --- /dev/null +++ b/include/fti-defs.h @@ -0,0 +1,3 @@ +#ifndef __FTI_DEFS__ +#define __FTI_DEFS__ +#endif // __FTI_DEFS__ diff --git a/include/fti-intern.h b/include/fti-intern.h index 236af9015..216a68318 100644 --- a/include/fti-intern.h +++ b/include/fti-intern.h @@ -525,6 +525,7 @@ extern "C" { size_t cHostBufSize; /**< Host buffer size for GPU data.*/ char suffix[4]; /** Suffix of the checkpoint files */ FTIT_dcpConfigurationPosix dcpInfoPosix; /**< dCP info for posix I/O */ + // int fastForward; /**< Fast forward rate for ckpt intervals */ } FTIT_configuration; /** @typedef FTIT_topology @@ -699,6 +700,7 @@ extern "C" { MPI_Comm groupComm; /**< Group communicator. */ MPI_Comm nodeComm; FTIT_dcpExecutionPosix dcpInfoPosix; /**< dCP info for posix I/O */ + int fastForward; /**< Fast forward rate for ckpt intervals */ /** A function pointer pointing to the function which actually the * checkpoint file. Noticeably We need 2 function pointers, One for the * Level 4 checkpoint And one for the remaining cases */ diff --git a/src/checkpoint.c b/src/checkpoint.c index 2c34c7955..631abc98b 100644 --- a/src/checkpoint.c +++ b/src/checkpoint.c @@ -79,6 +79,7 @@ int FTI_UpdateIterTime(FTIT_execution* FTI_Exec) { FTI_Exec->ckptIntv = 1; } else { FTI_Exec->ckptIntv = rint(60.0 / FTI_Exec->globMeanIter); + FTI_Exec->ckptIntv = ceil((double)FTI_Exec->ckptIntv/FTI_Exec->fastForward); } res = FTI_Exec->ckptLast + FTI_Exec->ckptIntv; if (FTI_Exec->ckptLast == 0) { diff --git a/src/conf.c b/src/conf.c index ab1858172..8bdd144f8 100644 --- a/src/conf.c +++ b/src/conf.c @@ -142,6 +142,9 @@ int FTI_ReadConf(FTIT_configuration* FTI_Conf, FTIT_execution* FTI_Exec, // 0 -> disabled FTI_Ckpt[4].ckptDcpIntv = (int)iniparser_getint(ini, "Basic:dcp_l4", 0); FTI_Ckpt[4].ckptIntv = (int)iniparser_getint(ini, "Basic:ckpt_l4", -1); + // Fast Forward flag + // FTI_Conf->fastForward = (int)iniparser_getint(ini, "Basic:fast_forward", 1); + FTI_Exec->fastForward = (int)iniparser_getint(ini, "Advanced:fast_forward", 1); FTI_Ckpt[1].isInline = (int)1; FTI_Ckpt[2].isInline = (int)iniparser_getint(ini, "Basic:inline_l2", 1); FTI_Ckpt[3].isInline = (int)iniparser_getint(ini, "Basic:inline_l3", 1); @@ -387,6 +390,17 @@ int FTI_TestConfig(FTIT_configuration* FTI_Conf, FTIT_topology* FTI_Topo, return FTI_NSCS; } + //fast forward + if (FTI_Exec->fastForward < 1 || FTI_Exec->fastForward > 10) { + FTI_Print("Fast Forward should be between 1 and 10, inclusive", FTI_WARN); + return FTI_NSCS; + } + + if ( FTI_Exec->fastForward < 10 && FTI_Exec->fastForward > 1) { + FTI_Print("Fast Forward flag is set.", FTI_WARN); + return FTI_NSCS; + } + // check dCP settings only if dCP is enabled if (FTI_Conf->dcpPosix) { if (FTI_Conf->dcpInfoPosix.StackSize > MAX_STACK_SIZE) {