about summary refs log tree commit diff
path: root/src/gemma.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gemma.cpp')
-rw-r--r--src/gemma.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gemma.cpp b/src/gemma.cpp
index c73c174..a50d8ab 100644
--- a/src/gemma.cpp
+++ b/src/gemma.cpp
@@ -2,7 +2,7 @@
     Genome-wide Efficient Mixed Model Association (GEMMA)
     Copyright © 2011-2017, Xiang Zhou
     Copyright © 2017, Peter Carbonetto
-    Copyright © 2017-2021, Pjotr Prins
+    Copyright © 2017-2025, Pjotr Prins
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -65,6 +65,8 @@ extern "C" {
 
 using namespace std;
 
+string checkpoint_name;   // -checkpoint switch is global
+
 GEMMA::GEMMA(void) : version(GEMMA_VERSION), date(GEMMA_DATE), year(GEMMA_YEAR) {}
 
 void gemma_gsl_error_handler (const char * reason,
@@ -726,6 +728,7 @@ void GEMMA::PrintHelp(size_t option) {
     cout << " -nind       [num]        read up to num individuals" << endl;
     cout << " -issue      [num]        enable tests relevant to issue tracker" << endl;
     cout << " -legacy                  run gemma in legacy mode" << endl;
+    cout << " -checkpoint [name]       set checkpoint (see pangemma docs)" << endl;
     cout << endl;
   }
 
@@ -1623,6 +1626,14 @@ void GEMMA::Assign(int argc, char **argv, PARAM &cPar) {
     } else if (strcmp(argv[i], "-legacy") == 0) {
       debug_set_legacy_mode(true);
       warning_msg("you are running in legacy mode - support may drop in future versions of gemma");
+    } else if (strcmp(argv[i], "-checkpoint") == 0) {
+      if (argv[i + 1] == NULL || argv[i + 1][0] == '-') {
+        continue;
+      }
+      ++i;
+      str.clear();
+      str.assign(argv[i]);
+      checkpoint_name = str;
     } else {
       cout << "error! unrecognized option: " << argv[i] << endl;
       cPar.error = true;