import os
print(os.environ)
import os
os.environ["KMP_AFFINITY"] = kmp_affinity
os.environ["KMP_SETTINGS"] = kmp_settings
os.environ["OMP_NUM_THREADS"] = omp_num_threads
os.environ["KMP_BLOCKTIME"] = kmp_blocktime
if "KMP_AFFINITY" in os.environ:
kmp_affinity = os.environ["KMP_AFFINITY"]
if "KMP_SETTINGS" in os.environ:
kmp_settings = os.environ["KMP_SETTINGS"]
if "ZOO_NUM_MKLTHREADS" in os.environ:
if os.environ["ZOO_NUM_MKLTHREADS"].lower() == "all":
omp_num_threads = conf.get('spark.executor.cores', str(multiprocessing.cpu_count()))
else:
omp_num_threads = os.environ["ZOO_NUM_MKLTHREADS"]
elif "OMP_NUM_THREADS" in os.environ:
omp_num_threads = os.environ["OMP_NUM_THREADS"]
if "KMP_BLOCKTIME" in os.environ:
kmp_blocktime = os.environ["KMP_BLOCKTIME"]
if "KMP_AFFINITY" in os.environ:
kmp_affinity = os.environ["KMP_AFFINITY"]
if "KMP_SETTINGS" in os.environ:
kmp_settings = os.environ["KMP_SETTINGS"]
if "ZOO_NUM_MKLTHREADS" in os.environ:
if os.environ["ZOO_NUM_MKLTHREADS"].lower() == "all":
omp_num_threads = conf.get('spark.executor.cores', str(multiprocessing.cpu_count()))
else:
omp_num_threads = os.environ["ZOO_NUM_MKLTHREADS"]
elif "OMP_NUM_THREADS" in os.environ:
omp_num_threads = os.environ["OMP_NUM_THREADS"]
if "KMP_BLOCKTIME" in os.environ:
kmp_blocktime = os.environ["KMP_BLOCKTIME"]
conf.set("spark.executorEnv.KMP_AFFINITY", kmp_affinity)
conf.set("spark.executorEnv.KMP_SETTINGS", kmp_settings)
conf.set("spark.executorEnv.KMP_BLOCKTIME", kmp_blocktime)
conf.set("spark.executorEnv.OMP_NUM_THREADS", omp_num_threads)
os.environ["KMP_AFFINITY"] = kmp_affinity
os.environ["KMP_SETTINGS"] = kmp_settings
os.environ["OMP_NUM_THREADS"] = omp_num_threads
os.environ["KMP_BLOCKTIME"] = kmp_blocktime