Parallel Programming - Final version
[matches/honours.git] / course / semester2 / pprog / assignment1 / nbody-bh / nbody.h~
diff --git a/course/semester2/pprog/assignment1/nbody-bh/nbody.h~ b/course/semester2/pprog/assignment1/nbody-bh/nbody.h~
new file mode 100644 (file)
index 0000000..b9fea98
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef _NBODY_BARNES_HUT_H
+#define _NBODY_BARNES_HUT_H
+
+/**
+ * @file nbody.h
+ * @purpose OpenMP version of N-Body simulator, declarations
+ * @author Sam Moore (20503628) - 2012
+ */
+
+#include "../single-thread/nbody.h" //Include original code
+#include <omp.h>
+
+
+#undef SINGLE_THREADED
+#define BARNES_HUT
+
+// Define to simultaneously Brute force a copy of the universe, and display together
+//#define DUAL_UNIVERSE 
+
+
+// Replace default macros with thread-safe functions
+#undef Simulation_Run
+void Simulation_Run(int argc, char ** argv);
+//#undef QuitProgram
+//#define QuitProgram(x) break
+
+#undef BeforeDraw
+#ifdef DUAL_UNIVERSE
+       System alternate_universe;
+       void BeforeDraw();
+#else
+       #define BeforeDraw() (void)0 // Do nothing (apparently this is how to do nothing with a macro)
+#endif //DUAL_UNIVERSE
+
+#undef AfterDraw 
+#define AfterDraw() (void)0
+//void AfterDraw();
+
+#undef QuitProgram
+void QuitProgram(bool error);
+
+void Compute(void);
+
+#endif //_NBODY_BARNES_HUT_H
+
+//EOF

UCC git Repository :: git.ucc.asn.au