#ifndef _NBODY_OPENMP_H #define _NBODY_OPENMP_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 #undef SINGLE_THREADED #define OMP_THREADED #define CRAPPY_VERSION // 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 #define BeforeDraw() (void)0 // Do nothing (apparently this is how to do nothing with a macro) //void BeforeDraw(); #undef AfterDraw #define AfterDraw() (void)0 //void AfterDraw(); omp_lock_t graphics_lock; 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 //EOF