To see if the environment is correct at the beginning of each process:
strace -f -o strace.out -e trace=execve -v -s 500 my_executable my_args...
You might also look at "ltrace" and filter to select only getenv() and putenv().
https://en.wikipedia.org/wiki/Ltrace
To provide some additional protection to environment variable OMP_NUM_THREADS,
then move its definition to somewhere else. Something like [not tested]:
static char my_num_threads[50];
char const *old_def = getenv("OMP_NUM_THREADS");
if (old_def) {
snprintf(my_num_threads, sizeof(my_num_threads), "OMP_NUM_THREADS=%s",
old_def);
fprintf(stderr, "Setting %s\n", my_num_threads);
putenv(my_num_threads);
}
else {
fprintf(stderr, "Could not find OMP_NUM_THREADS\n");
}
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users