X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=course%2Fsemester2%2Fpprog%2Fassignment1%2Fopenmp%2Fnbody.h;fp=course%2Fsemester2%2Fpprog%2Fassignment1%2Fopenmp%2Fnbody.h;h=aea97bfc74fd9da51e4c5e1cb37552f758844212;hb=bb7fa31ea517a1fba064e723b37d5b8d8bd7dd72;hp=3e3d2718beab4e55908b7099688a71d75d814f7d;hpb=20979b1c07eda73b7f86b2fe8cb66eb58d959e04;p=matches%2Fhonours.git diff --git a/course/semester2/pprog/assignment1/openmp/nbody.h b/course/semester2/pprog/assignment1/openmp/nbody.h index 3e3d2718..aea97bfc 100644 --- a/course/semester2/pprog/assignment1/openmp/nbody.h +++ b/course/semester2/pprog/assignment1/openmp/nbody.h @@ -21,14 +21,26 @@ #undef Simulation_Run void Simulation_Run(int argc, char ** argv); //#undef QuitProgram -//void QuitProgram(bool error); +//#define QuitProgram(x) break #undef BeforeDraw -void BeforeDraw(); -#undef AfterDraw -void AfterDraw(); +#define BeforeDraw() (void)0 // Do nothing (apparently this is how to do nothing with a macro) +//void BeforeDraw(); -void Compute(); //Compute a single step +#undef AfterDraw +#define AfterDraw() (void)0 +//void AfterDraw(); + + + +void Compute(void); +void Compute2(void); + +//#define OVER_ENGINEERED +// define to (my original approach) manually split the System array (same as pthread version) between threads +// Manually splitting the System array is not required in openmp, since "#pragma omp for" automatically does it +// I still like doing it this way, since you can explicitly see what each thread is doing, but it would probably lose me marks. +// However I can't bring myself to delete it. Hence, compromise. #endif //_NBODY_OPENMP_H