Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 14e43a5

Browse files
committed
IMPORTANT: Refactor --redo option, introduce --redo-tree and document --undo
1 parent 5f63372 commit 14e43a5

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

main/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,10 @@ int main(int argc, char *argv[]) {
23872387
delete checkpoint;
23882388
if (MPIHelper::getInstance().isMaster())
23892389
outError("Checkpoint (" + filename + ") indicates that a previous run successfully finished\n" +
2390-
"Use `-redo` option if you really want to redo the analysis and overwrite all output files.");
2390+
"Use `-redo` option if you really want to redo the analysis and overwrite all output files.\n" +
2391+
"Use `--redo-tree` option if you want to restore ModelFinder and only redo tree search.\n" +
2392+
"Use `--undo` option if you want to continue previous run when changing/adding options."
2393+
);
23912394
else
23922395
exit(EXIT_SUCCESS);
23932396
exit(EXIT_FAILURE);

utils/tools.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ void parseArg(int argc, char *argv[], Params &params) {
23822382
params.modelomatic = true;
23832383
continue;
23842384
}
2385-
if (strcmp(argv[cnt], "-mredo") == 0 || strcmp(argv[cnt], "--model-redo") == 0) {
2385+
if (strcmp(argv[cnt], "-mredo") == 0 || strcmp(argv[cnt], "--mredo") == 0 || strcmp(argv[cnt], "--model-redo") == 0) {
23862386
params.model_test_again = true;
23872387
continue;
23882388
}
@@ -3981,10 +3981,17 @@ void parseArg(int argc, char *argv[], Params &params) {
39813981

39823982
if (strcmp(argv[cnt], "-redo") == 0 || strcmp(argv[cnt], "--redo") == 0) {
39833983
params.ignore_checkpoint = true;
3984+
// 2020-04-27: SEMANTIC CHANGE: also redo ModelFinder
3985+
params.model_test_again = true;
39843986
continue;
39853987
}
39863988

3987-
if (strcmp(argv[cnt], "--undo") == 0) {
3989+
if (strcmp(argv[cnt], "-tredo") == 0 || strcmp(argv[cnt], "--tredo") == 0 || strcmp(argv[cnt], "--redo-tree") == 0) {
3990+
params.ignore_checkpoint = true;
3991+
continue;
3992+
}
3993+
3994+
if (strcmp(argv[cnt], "-undo") == 0 || strcmp(argv[cnt], "--undo") == 0) {
39883995
params.force_unfinished = true;
39893996
continue;
39903997
}
@@ -4323,7 +4330,6 @@ void usage_iqtree(char* argv[], bool full_command) {
43234330
<< " --safe Safe likelihood kernel to avoid numerical underflow" << endl
43244331
<< " --mem NUM[G|M|%] Maximal RAM usage in GB | MB | %" << endl
43254332
<< " --runs NUM Number of indepedent runs (default: 1)" << endl
4326-
<< " --redo Ignore checkpoint and overwrite outputs (default: OFF)" << endl
43274333
<< " -v, --verbose Verbose mode, printing more messages to screen" << endl
43284334
<< " -V, --version Display version number" << endl
43294335
<< " --quiet Quiet mode, suppress printing to screen (stdout)" << endl
@@ -4333,6 +4339,11 @@ void usage_iqtree(char* argv[], bool full_command) {
43334339
<< " -T NUM|AUTO No. cores/threads or AUTO-detect (default: 1)" << endl
43344340
<< " --threads-max NUM Max number of threads for -T AUTO (default: all cores)" << endl
43354341
#endif
4342+
<< endl << "CHECKPOINT:" << endl
4343+
<< " --redo Redo both ModelFinder and tree search" << endl
4344+
<< " --redo-tree Restore ModelFinder and only redo tree search" << endl
4345+
<< " --undo Revoke finished run, used when changing some options" << endl
4346+
<< " --cptime NUM Minimum checkpoint interval (default: 60 sec and adapt)" << endl
43364347
<< endl << "PARTITION MODEL:" << endl
43374348
<< " -p FILE|DIR NEXUS/RAxML partition file or directory with alignments" << endl
43384349
<< " Edge-linked proportional partition model" << endl
@@ -4417,7 +4428,6 @@ void usage_iqtree(char* argv[], bool full_command) {
44174428
<< " --merit AIC|AICc|BIC Akaike|Bayesian information criterion (default: BIC)" << endl
44184429
// << " -msep Perform model selection and then rate selection" << endl
44194430
<< " --mtree Perform full tree search for every model" << endl
4420-
<< " --mredo Ignore .model.gz checkpoint file (default: OFF)" << endl
44214431
<< " --madd STR,... List of mixture models to consider" << endl
44224432
<< " --mdef FILE Model definition NEXUS file (see Manual)" << endl
44234433
<< " --modelomatic Find best codon/protein/DNA models (Whelan et al. 2015)" << endl
@@ -4587,7 +4597,6 @@ void usage_iqtree(char* argv[], bool full_command) {
45874597

45884598
<< endl << "MISCELLANEOUS:" << endl
45894599
<< " --keep-ident Keep identical sequences (default: remove & finally add)" << endl
4590-
<< " --cptime NUM Checkpoint time interval in seconds (default: 60)" << endl
45914600
<< " -blfix Fix branch lengths of user tree passed via -te" << endl
45924601
<< " -blscale Scale branch lengths of user tree passed via -t" << endl
45934602
<< " -blmin Min branch length for optimization (default 0.000001)" << endl

0 commit comments

Comments
 (0)