[cig-commits] [commit] master: Add PID function to framework (5e73413)

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


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

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

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

commit 5e7341340eb04d0593a410f55b2b2ab3e6bc10fe
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Tue Oct 21 14:01:36 2014 -0700

    Add PID function to framework


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

5e7341340eb04d0593a410f55b2b2ab3e6bc10fe
 CMakeLists.txt            | 1 +
 config.h.in               | 1 +
 src/core/SimFramework.cpp | 3 +++
 src/core/SimFramework.h   | 9 +++++++++
 4 files changed, 14 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb46229..6541b0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ CHECK_INCLUDE_FILES ("sys/time.h" VC_HAVE_SYS_TIME_H)
 CHECK_INCLUDE_FILES ("math.h" VC_HAVE_MATH_H)
 CHECK_INCLUDE_FILES ("stdlib.h" VC_HAVE_STDLIB_H)
 CHECK_INCLUDE_FILES ("unistd.h" VC_HAVE_UNISTD_H)
+CHECK_INCLUDE_FILES ("string.h" VC_HAVE_STRING_H)
 
 # Check for functions
 INCLUDE (CheckFunctionExists)
diff --git a/config.h.in b/config.h.in
index 2618296..56a2b2c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -5,6 +5,7 @@
 #cmakedefine VC_HAVE_MATH_H
 #cmakedefine VC_HAVE_STDLIB_H
 #cmakedefine VC_HAVE_UNISTD_H
+#cmakedefine VC_HAVE_STRING_H
 #cmakedefine VC_HAVE_SLEEP_FUNC
 #cmakedefine VC_HAVE_USLEEP_FUNC
 #cmakedefine HDF5_FOUND
diff --git a/src/core/SimFramework.cpp b/src/core/SimFramework.cpp
index ad7b087..0fb28a9 100644
--- a/src/core/SimFramework.cpp
+++ b/src/core/SimFramework.cpp
@@ -22,7 +22,10 @@
 #include <iomanip>
 #include <sstream>
 #include <stdexcept>
+
+#ifdef VC_HAVE_STRING_H
 #include <string.h>
+#endif
 
 #ifdef _OPENMP
 #include <omp.h>
diff --git a/src/core/SimFramework.h b/src/core/SimFramework.h
index 41abb2b..e12990b 100644
--- a/src/core/SimFramework.h
+++ b/src/core/SimFramework.h
@@ -36,6 +36,10 @@
 #include <stdlib.h>
 #endif
 
+#ifdef VC_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #include <map>
 
 #include "SimTimer.h"
@@ -203,6 +207,11 @@ class SimFramework : public virtual SimTimer {
         unsigned int itersPerSecond(void) const {
             return (unsigned int)iters_per_sec;
         };
+    
+    // Other functions
+    unsigned int getPID(void) const {
+        return getpid();
+    };
 };
 
 #endif



More information about the CIG-COMMITS mailing list