1 #ifndef _NBODY_OPENMP_H
2 #define _NBODY_OPENMP_H
6 * @purpose OpenMP version of N-Body simulator, declarations
7 * @author Sam Moore (20503628) - 2012
10 #include "../single-thread/nbody.h" //Include original code
14 #undef SINGLE_THREADED
18 #define CRAPPY_VERSION
20 // Replace default macros with thread-safe functions
22 void Simulation_Run(int argc, char ** argv);
24 //#define QuitProgram(x) break
27 #define BeforeDraw() (void)0 // Do nothing (apparently this is how to do nothing with a macro)
31 #define AfterDraw() (void)0
35 void QuitProgram(bool error);
40 //#define OVER_ENGINEERED
41 // define to (my original approach) manually split the System array (same as pthread version) between threads
42 // Manually splitting the System array is not required in openmp, since "#pragma omp for" automatically does it
43 // I still like doing it this way, since you can explicitly see what each thread is doing, but it would probably lose me marks.
44 // However I can't bring myself to delete it. Hence, compromise.
46 #endif //_NBODY_OPENMP_H