[cig-commits] [commit] master: Save copy of param file when running (c0865c6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Oct 21 16:27:38 PDT 2014


Repository : https://github.com/geodynamics/vc

On branch  : master
Link       : https://github.com/geodynamics/vc/compare/64c223c129f70f3916341f1ebdf52f6d2ae1deae...de41758e125fcac4ea5fb0935597c3b662ff523c

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

commit c0865c64332917864d558c01440caeb2d0e8c0b4
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Tue Oct 21 15:45:56 2014 -0700

    Save copy of param file when running


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

c0865c64332917864d558c01440caeb2d0e8c0b4
 src/core/VCSimulation.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/core/VCSimulation.cpp b/src/core/VCSimulation.cpp
index 8337d2b..a92f12c 100644
--- a/src/core/VCSimulation.cpp
+++ b/src/core/VCSimulation.cpp
@@ -22,10 +22,17 @@
 #include "SimFramework.h"
 #include "SimError.h"
 
+#ifdef VC_HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+
+#ifdef VC_HAVE_STRING_H
 #include <string.h>
+#endif
+
 #include <list>
 #include <vector>
+#include <sstream>
 
 #ifdef _OPENMP
 #include <omp.h>
@@ -52,6 +59,14 @@ VCSimulation::VCSimulation(int argc, char **argv) : SimFramework(argc, argv) {
                 "sim.start_year: Start year must be before end year.");
     assertThrow(getGreensCalcMethod() != GREENS_CALC_UNDEFINED,
                 "Greens calculation method must be either standard, Barnes Hut or file based.");
+
+    // Now that we have the parameters, write them out to a file
+    // on the root node for record keeping purposes
+    if (isRootNode()) {
+        std::stringstream    param_file_name;
+        param_file_name << "vc_params_" << getPID() << ".prm";
+        this->write_params(param_file_name.str());
+    }
 }
 
 /*!



More information about the CIG-COMMITS mailing list