aea97bfc74fd9da51e4c5e1cb37552f758844212
[matches/honours.git] / course / semester2 / pprog / assignment1 / openmp / nbody.h
1 #ifndef _NBODY_OPENMP_H
2 #define _NBODY_OPENMP_H
3
4 /**
5  * @file nbody.h
6  * @purpose OpenMP version of N-Body simulator, declarations
7  * @author Sam Moore (20503628) - 2012
8  */
9
10 #include "../single-thread/nbody.h" //Include original code
11 #include <omp.h>
12
13
14 #undef SINGLE_THREADED
15 #define OMP_THREADED
16
17
18 #define CRAPPY_VERSION
19
20 // Replace default macros with thread-safe functions
21 #undef Simulation_Run
22 void Simulation_Run(int argc, char ** argv);
23 //#undef QuitProgram
24 //#define QuitProgram(x) break
25
26 #undef BeforeDraw
27 #define BeforeDraw() (void)0 // Do nothing (apparently this is how to do nothing with a macro)
28 //void BeforeDraw();
29
30 #undef AfterDraw 
31 #define AfterDraw() (void)0
32 //void AfterDraw();
33
34
35
36 void Compute(void);
37 void Compute2(void);
38
39 //#define OVER_ENGINEERED 
40 // define to (my original approach) manually split the System array (same as pthread version) between threads
41 //      Manually splitting the System array is not required in openmp, since "#pragma omp for" automatically does it
42 //      I still like doing it this way, since you can explicitly see what each thread is doing, but it would probably lose me marks.
43 //      However I can't bring myself to delete it. Hence, compromise.
44
45 #endif //_NBODY_OPENMP_H
46
47 //EOF

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