Fixed #10. Supported GOTO_NUM_THREADS & GOTO_THREADS_TIMEOUT environment variables.

This commit is contained in:
Xianyi Zhang
2011-02-24 15:16:21 +08:00
parent cd2cbabecc
commit 128418f49b
5 changed files with 35 additions and 5 deletions

View File

@@ -581,6 +581,7 @@ void gotoblas_affinity_init(void) {
numprocs = 0;
#else
numprocs = readenv("OPENBLAS_NUM_THREADS");
if (numprocs == 0) numprocs = readenv("GOTO_NUM_THREADS");
#endif
if (numprocs == 0) numprocs = readenv("OMP_NUM_THREADS");
@@ -666,7 +667,7 @@ void gotoblas_affinity_init(void) {
setup_mempolicy();
if (readenv("OPENBLAS_MAIN_FREE")) {
if (readenv("OPENBLAS_MAIN_FREE") || readenv("GOTOBLAS_MAIN_FREE")) {
sched_setaffinity(0, sizeof(cpu_orig_mask), &cpu_orig_mask[0]);
}