aboutsummaryrefslogtreecommitdiff
path: root/Carpet/LoopControl
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2009-01-26 19:11:23 -0600
committerErik Schnetter <schnetter@cct.lsu.edu>2009-01-26 19:11:23 -0600
commit788293486417b5d78226c9f1ed62cdd83d0991db (patch)
tree6e1f2115c6c766ebfb10af3a60e6c94d8e1aa849 /Carpet/LoopControl
parentef9913f0b3c06608425c6c5f25569b9b27f86286 (diff)
parent45377e6a4a1602b4ff79d38f4583842986d5a355 (diff)
Merge branch 'master' of /Users/eschnett/Cbeta/carpet/
Diffstat (limited to 'Carpet/LoopControl')
-rw-r--r--Carpet/LoopControl/src/wavetoy-loopcontrol.c52
1 files changed, 34 insertions, 18 deletions
diff --git a/Carpet/LoopControl/src/wavetoy-loopcontrol.c b/Carpet/LoopControl/src/wavetoy-loopcontrol.c
index 0b7ce7782..f7fa99a40 100644
--- a/Carpet/LoopControl/src/wavetoy-loopcontrol.c
+++ b/Carpet/LoopControl/src/wavetoy-loopcontrol.c
@@ -33,8 +33,8 @@
#include <stdlib.h>
#ifdef _OPENMP
-
-#include <omp.h>
+# include <omp.h>
+#endif
#include "loopcontrol.h"
@@ -45,6 +45,38 @@
#define BUILD_STANDALONE
***/
+
+
+#ifndef _OPENMP
+/* Replacements for some OpenMP routines if OpenMP is not available */
+
+static inline
+int
+omp_get_thread_num (void)
+{
+ return 0;
+}
+
+static inline
+int
+omp_get_num_threads (void)
+{
+ return 1;
+}
+
+static inline
+double
+omp_get_wtime (void)
+{
+ struct timeval tv;
+ gettimeofday (& tv, NULL);
+ return tv.tv_sec + 1.0e-6 * tv.tv_usec;
+}
+
+#endif
+
+
+
static int NI;
static int NJ;
static int NK;
@@ -234,19 +266,3 @@ int lc_demo (void)
//
return 0;
}
-#else
-#ifdef BUILD_STANDALONE
- int main(void) {
- printf("\n We do not have OpenMP. Can't do anything. \n");
- return 0;
- }
-#else
- int lc_demo (void)
- {
- printf("\n We do not have OpenMP. Can't do anything. \n");
- return 0;
- }
-#endif
-
-
-#endif