@@ -39,28 +39,29 @@ static const char* verbose;
3939
4040#if FORCE_PRELOADING
4141#define VERBOSE (...) if(verbose) printf("mkl-service + Intel(R) MKL: " __VA_ARGS__)
42+
4243static void restore_mtlayer (void ) {
4344 if (mtlayer ) {
44- VERBOSE ("Re-setting Intel(R) MKL_THREADING_LAYER=%s for the forked process\n" , mtlayer ); \
45- setenv ("MKL_THREADING_LAYER" , mtlayer , 1 );
45+ VERBOSE ("Re-setting Intel(R) MKL_THREADING_LAYER=%s for the forked process\n" , mtlayer );
46+ setenv ("MKL_THREADING_LAYER" , mtlayer , 1 );
4647 } else {
47- VERBOSE ("Unsetting Intel(R) MKL_THREADING_LAYER variable for the forked process \n" ); \
48- unsetenv ("MKL_THREADING_LAYER" );
48+ VERBOSE ("Unsetting Intel(R) MKL_THREADING_LAYER variable for the forked process \n" );
49+ unsetenv ("MKL_THREADING_LAYER" );
4950 }
5051}
5152#endif
5253
5354static void _preload_threading_layer (void ) {
5455#if FORCE_PRELOADING
55- #define SET_MTLAYER (L ) do { \
56+ #define SET_MTLAYER (L ) do { \
5657 VERBOSE("setting Intel(R) MKL to use " #L " OpenMP runtime\n"); \
57- mkl_set_threading_layer(MKL_THREADING_##L); \
58- setenv("MKL_THREADING_LAYER", #L, 0); \
59- pthread_atfork(NULL, NULL, &restore_mtlayer); \
58+ mkl_set_threading_layer(MKL_THREADING_##L); \
59+ setenv("MKL_THREADING_LAYER", #L, 0); \
60+ pthread_atfork(NULL, NULL, &restore_mtlayer); \
6061 } while(0)
61- #define PRELOAD (lib ) do { \
62- VERBOSE("preloading %s runtime\n", lib); \
63- dlopen(lib, RTLD_LAZY|RTLD_GLOBAL); \
62+ #define PRELOAD (lib ) do { \
63+ VERBOSE("preloading %s runtime\n", lib); \
64+ dlopen(lib, RTLD_LAZY|RTLD_GLOBAL); \
6465 } while(0)
6566 /*
6667 * The following is the pseudo-code skeleton for reinterpreting unset MKL_THREADING_LAYER
0 commit comments