diff --git a/platforms/50_cheyenne_gnu_economy/SWEETPlatform.py b/platforms/50_cheyenne_gnu_economy/SWEETPlatform.py index 97c073a28..1c89e629f 100644 --- a/platforms/50_cheyenne_gnu_economy/SWEETPlatform.py +++ b/platforms/50_cheyenne_gnu_economy/SWEETPlatform.py @@ -1,6 +1,7 @@ import platform import socket import sys +import os from SWEET import * from . import SWEETPlatformAutodetect @@ -130,12 +131,14 @@ def jobscript_get_header(j : SWEETJobGeneration): if p.force_turbo_off: content += "#PBS -l select=cpufreq=2300000\n" + ld_library_path = os.getenv('LD_LIBRARY_PATH') + content += """# #PBS -N """+_job_id[0:100]+""" #PBS -o """+j.p_job_stdout_filepath+""" #PBS -e """+j.p_job_stderr_filepath+""" -source /etc/profile.d/modules.sh +#source /etc/profile.d/modules.sh #module load openmpi """+("module load mkl" if j.compile.mkl==True or j.compile.mkl=='enable' else "")+""" @@ -143,6 +146,16 @@ def jobscript_get_header(j : SWEETJobGeneration): """+p_gen_script_info(j)+""" +# Make sure that SWEET library path is really known +export LD_LIBRARY_PATH=\""""+ld_library_path+""":$LD_LIBRARY_PATH\" + + +echo +echo "LD_LIBRARY_PATH" +echo "${LD_LIBRARY_PATH}" +echo + + echo echo "hostname" hostname @@ -158,7 +171,6 @@ def jobscript_get_header(j : SWEETJobGeneration): cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq | sort -u echo - """ if j.compile.threading != 'off': @@ -166,11 +178,18 @@ def jobscript_get_header(j : SWEETJobGeneration): export OMP_NUM_THREADS="""+str(p.num_threads_per_rank)+""" """ - content += """ - -export OMP_PROC_BIND=close - -""" + if p.core_oversubscription: + raise Exception("Not supported with this script!") + + if p.core_affinity != None: + + content += "\necho \"Affnity: "+str(p.core_affinity)+"\"\n" + if p.core_affinity == 'compact': + content += "\nexport OMP_PROC_BIND=close\n" + elif p.core_affinity == 'scatter': + content += "\nexport OMP_PROC_BIND=spread\n" + else: + raise Exception("Affinity '"+str(p.core_affinity)+"' not supported") return content diff --git a/platforms/50_cheyenne_intel_economy/SWEETPlatform.py b/platforms/50_cheyenne_intel_economy/SWEETPlatform.py index 3cfb7b22b..e758f8cfe 100644 --- a/platforms/50_cheyenne_intel_economy/SWEETPlatform.py +++ b/platforms/50_cheyenne_intel_economy/SWEETPlatform.py @@ -1,6 +1,7 @@ import platform import socket import sys +import os from SWEET import * from . import SWEETPlatformAutodetect @@ -130,7 +131,7 @@ def jobscript_get_header(j : SWEETJobGeneration): if p.force_turbo_off: content += "#PBS -l select=cpufreq=2300000\n" - ld_library_path = sys.getenv('LD_LIBRARY_PATH') + ld_library_path = os.getenv('LD_LIBRARY_PATH') content += """# #PBS -N """+_job_id[0:100]+""" diff --git a/python_mods/SWEETParallelization.py b/python_mods/SWEETParallelization.py index 80903f082..590b4d54b 100755 --- a/python_mods/SWEETParallelization.py +++ b/python_mods/SWEETParallelization.py @@ -52,6 +52,16 @@ def __init__(self): # Force disabling of turbo mode (if supported) self.force_turbo_off = False + # Qualitative settings + + # Allow oversubscription (aka Hyperthreading) + self.core_oversubscription = False + + # affinities: + # compact, scatter + self.core_affinity = None + + def reset(self): """ diff --git a/scripts/SWEETParameters.py b/scripts/SWEETParameters.py deleted file mode 120000 index 5d8e5407d..000000000 --- a/scripts/SWEETParameters.py +++ /dev/null @@ -1 +0,0 @@ -../python_mods/SWEETParameters.py \ No newline at end of file