samedi 28 février 2015

Disabling OpenMP when Profiling Enabled

When profiling my C code, I would like to disable/reduce the number of OMP threads to 1. After a brief search, I found this question. I would therefore decided to do something like



#ifdef foo
#define omp_get_thread_num() 0
#endif


where foo is a macro that is true if the -pg flag is set when compiling with GCC.


My question then is, what is the value of foo and will this method now allow me to get sensible profiling information (by forcing OpenMP to just use one thread).


Aucun commentaire:

Enregistrer un commentaire