Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion script/app-abinit/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_ABINIT_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_ABINIT_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_ABINIT_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
3 changes: 2 additions & 1 deletion script/app-alphafold/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_ALPHAFOLD_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_ALPHAFOLD_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_ALPHAFOLD_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
6 changes: 4 additions & 2 deletions script/app-ansys-fluent/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def preprocess(i):
if i['os_info']['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for Ansys Fluent builds'}
return {'return': 1,
'error': 'Windows is not supported for Ansys Fluent builds'}
return {'return': 0}


Expand All @@ -14,7 +15,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_ANSYS_FLUENT_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_ANSYS_FLUENT_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_ANSYS_FLUENT_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
6 changes: 4 additions & 2 deletions script/app-berkeleygw/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def preprocess(i):
if i['os_info']['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for BerkeleyGW builds'}
return {'return': 1,
'error': 'Windows is not supported for BerkeleyGW builds'}
return {'return': 0}


Expand All @@ -14,7 +15,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_BERKELEYGW_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_BERKELEYGW_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_BERKELEYGW_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
3 changes: 2 additions & 1 deletion script/app-blast/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def postprocess(i):

binary = os.path.join(bin_dir, 'blastn')
if not os.path.isfile(binary):
return {'return': 1, 'error': f'BLAST+ binary (blastn) not found in {bin_dir}'}
return {'return': 1,
'error': f'BLAST+ binary (blastn) not found in {bin_dir}'}

env['MLC_BLAST_INSTALL_PATH'] = install_dir
env['MLC_BLAST_BIN_PATH'] = bin_dir
Expand Down
3 changes: 2 additions & 1 deletion script/app-calculix/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_CALCULIX_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_CALCULIX_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_CALCULIX_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
3 changes: 2 additions & 1 deletion script/app-castep/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_CASTEP_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_CASTEP_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_CASTEP_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
8 changes: 7 additions & 1 deletion script/app-castro/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ def postprocess(i):
env = i['env']
src_path = env.get('MLC_CASTRO_SRC_PATH', '')
compiler_tag = env.get('MLC_COMPILER_FAMILY', '') or 'default'
hits = glob.glob(os.path.join(src_path, 'install-' + compiler_tag, 'bin', '*.ex'))
hits = glob.glob(
os.path.join(
src_path,
'install-' +
compiler_tag,
'bin',
'*.ex'))
if not hits:
return {'return': 1, 'error': f'Castro executable not found under {src_path}'}
bin_dir = os.path.dirname(hits[0])
Expand Down
3 changes: 2 additions & 1 deletion script/app-chroma/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_CHROMA_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_CHROMA_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_CHROMA_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
6 changes: 4 additions & 2 deletions script/app-cloverleaf/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ def preprocess(i):

os_info = i['os_info']
if os_info['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for CloverLeaf builds'}
return {'return': 1,
'error': 'Windows is not supported for CloverLeaf builds'}

return {'return': 0}

Expand All @@ -25,7 +26,8 @@ def postprocess(i):
# Try source directory
clover_bin = os.path.join(src_path, 'clover_leaf')
if not os.path.isfile(clover_bin):
return {'return': 1, 'error': f'CloverLeaf binary not found in {bin_dir} or {src_path}'}
return {
'return': 1, 'error': f'CloverLeaf binary not found in {bin_dir} or {src_path}'}
bin_dir = src_path

env['MLC_CLOVERLEAF_BIN_PATH'] = bin_dir
Expand Down
3 changes: 2 additions & 1 deletion script/app-code-aster/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

def preprocess(i):
if i['os_info']['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for Code_Aster builds'}
return {'return': 1,
'error': 'Windows is not supported for Code_Aster builds'}
return {'return': 0}


Expand Down
3 changes: 2 additions & 1 deletion script/app-code-saturne/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def preprocess(i):
if i['os_info']['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for code_saturne builds'}
return {'return': 1,
'error': 'Windows is not supported for code_saturne builds'}
return {'return': 0}


Expand Down
3 changes: 2 additions & 1 deletion script/app-dalton/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def postprocess(i):
if not os.path.isfile(binary):
return {'return': 1, 'error': f'DALTON binary not found at {binary}'}
bin_dir = os.path.dirname(binary)
env['MLC_DALTON_INSTALL_PATH'] = os.path.join(src_path, 'build-' + compiler_tag)
env['MLC_DALTON_INSTALL_PATH'] = os.path.join(
src_path, 'build-' + compiler_tag)
env['MLC_DALTON_BIN_PATH'] = bin_dir
env['+PATH'] = [bin_dir]
return {'return': 0}
3 changes: 2 additions & 1 deletion script/app-enzo/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def postprocess(i):

binary = os.path.join(bin_dir, 'enzo.exe')
if not os.path.isfile(binary):
return {'return': 1, 'error': f'Enzo binary (enzo.exe) not found in {bin_dir}'}
return {'return': 1,
'error': f'Enzo binary (enzo.exe) not found in {bin_dir}'}

env['MLC_ENZO_INSTALL_PATH'] = src_path
env['MLC_ENZO_BIN_PATH'] = bin_dir
Expand Down
9 changes: 8 additions & 1 deletion script/app-epoch/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ def postprocess(i):
env = i['env']
src_path = env.get('MLC_EPOCH_SRC_PATH', '')
compiler_tag = env.get('MLC_COMPILER_FAMILY', '') or 'default'
hits = glob.glob(os.path.join(src_path, 'install-' + compiler_tag, 'bin', 'epoch2d'), recursive=True)
hits = glob.glob(
os.path.join(
src_path,
'install-' +
compiler_tag,
'bin',
'epoch2d'),
recursive=True)
if not hits:
return {'return': 1, 'error': f'EPOCH artifact not found under {src_path}'}
bin_dir = os.path.dirname(hits[0])
Expand Down
3 changes: 2 additions & 1 deletion script/app-gadget4/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def postprocess(i):

binary = os.path.join(src_path, 'Gadget4')
if not os.path.isfile(binary):
return {'return': 1, 'error': f'GADGET-4 binary (Gadget4) not found in {src_path}'}
return {'return': 1,
'error': f'GADGET-4 binary (Gadget4) not found in {src_path}'}

env['MLC_GADGET4_INSTALL_PATH'] = src_path
env['MLC_GADGET4_BIN_PATH'] = src_path
Expand Down
11 changes: 8 additions & 3 deletions script/app-gaia-benchmark/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ def preprocess(i):
env = i['env']

backend = str(env.get('MLC_GAIA_BACKEND', 'mock')).lower()
if backend == 'endpoint' and not env.get('MLC_GAIA_ENDPOINT_URL', '').strip():
if backend == 'endpoint' and not env.get(
'MLC_GAIA_ENDPOINT_URL', '').strip():
return {'return': 1,
'error': 'endpoint backend requires --endpoint (MLC_GAIA_ENDPOINT_URL)'}

# The workload is executed by the benchmark-program posthook dependency.
python_bin = env.get('MLC_PYTHON_BIN_WITH_PATH', 'python3')
script = os.path.join(env['MLC_TMP_CURRENT_SCRIPT_PATH'], 'src', 'run_gaia.py')
script = os.path.join(
env['MLC_TMP_CURRENT_SCRIPT_PATH'],
'src',
'run_gaia.py')
env['MLC_RUN_CMD'] = f'{python_bin} "{script}"'
if not env.get('MLC_RUN_DIR', ''):
env['MLC_RUN_DIR'] = os.getcwd()
Expand All @@ -39,5 +43,6 @@ def postprocess(i):
env['MLC_GAIA_ACCURACY'] = str(data.get('accuracy', ''))
state['mlc_gaia'] = data

logger.info(f"GAIA accuracy ({data.get('trace_type')}): {data.get('accuracy')}")
logger.info(
f"GAIA accuracy ({data.get('trace_type')}): {data.get('accuracy')}")
return {'return': 0}
4 changes: 3 additions & 1 deletion script/app-gaia-benchmark/src/run_gaia.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def gen(system, user, max_tokens=512):
if backend == "hf":
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = _env("MLC_GAIA_HF_MODEL", "HuggingFaceTB/SmolLM2-135M-Instruct")
model_id = _env(
"MLC_GAIA_HF_MODEL",
"HuggingFaceTB/SmolLM2-135M-Instruct")
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
model.eval()
Expand Down
6 changes: 4 additions & 2 deletions script/app-gamess/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def preprocess(i):
if i['os_info']['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for GAMESS (US) builds'}
return {'return': 1,
'error': 'Windows is not supported for GAMESS (US) builds'}
return {'return': 0}


Expand All @@ -14,7 +15,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_GAMESS_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_GAMESS_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_GAMESS_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
3 changes: 2 additions & 1 deletion script/app-gaussian/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_GAUSSIAN_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_GAUSSIAN_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_GAUSSIAN_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
8 changes: 7 additions & 1 deletion script/app-geant4/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ def preprocess(i):
def postprocess(i):
env = i['env']
src_path = env.get('MLC_GEANT4_SRC_PATH', '')
hits = glob.glob(os.path.join(src_path, 'build', 'BuildProducts', 'lib', 'libG4global*'))
hits = glob.glob(
os.path.join(
src_path,
'build',
'BuildProducts',
'lib',
'libG4global*'))
if not hits:
return {'return': 1, 'error': f'Geant4 library not found under {src_path}'}
bin_dir = os.path.dirname(hits[0])
Expand Down
3 changes: 2 additions & 1 deletion script/app-genesis/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def postprocess(i):
if not os.path.isfile(binary):
return {'return': 1, 'error': f'GENESIS binary not found at {binary}'}
bin_dir = os.path.dirname(binary)
env['MLC_GENESIS_INSTALL_PATH'] = os.path.join(src_path, 'install-' + compiler_tag)
env['MLC_GENESIS_INSTALL_PATH'] = os.path.join(
src_path, 'install-' + compiler_tag)
env['MLC_GENESIS_BIN_PATH'] = bin_dir
env['+PATH'] = [bin_dir]
return {'return': 0}
3 changes: 2 additions & 1 deletion script/app-gromacs/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def postprocess(i):

gmx_bin = os.path.join(bin_dir, 'gmx_mpi')
if not os.path.isfile(gmx_bin):
return {'return': 1, 'error': f'GROMACS binary (gmx_mpi) not found in {bin_dir}'}
return {'return': 1,
'error': f'GROMACS binary (gmx_mpi) not found in {bin_dir}'}

env['MLC_GROMACS_BIN_PATH'] = bin_dir
env['MLC_GROMACS_INSTALL_PATH'] = install_dir
Expand Down
3 changes: 2 additions & 1 deletion script/app-hmmer/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def postprocess(i):

hmmsearch_bin = os.path.join(bin_dir, 'hmmsearch')
if not os.path.isfile(hmmsearch_bin):
return {'return': 1, 'error': f'HMMER binary (hmmsearch) not found in {bin_dir}'}
return {'return': 1,
'error': f'HMMER binary (hmmsearch) not found in {bin_dir}'}

env['MLC_HMMER_BIN_PATH'] = bin_dir
env['MLC_HMMER_INSTALL_PATH'] = install_dir
Expand Down
3 changes: 2 additions & 1 deletion script/app-hoomd-blue/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def preprocess(i):
if i['os_info']['platform'] == 'windows':
return {'return': 1, 'error': 'Windows is not supported for HOOMD-blue builds'}
return {'return': 1,
'error': 'Windows is not supported for HOOMD-blue builds'}
return {'return': 0}


Expand Down
11 changes: 8 additions & 3 deletions script/app-hotpotqa/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ def preprocess(i):
env = i['env']

backend = str(env.get('MLC_HOTPOTQA_BACKEND', 'mock')).lower()
if backend == 'endpoint' and not env.get('MLC_HOTPOTQA_ENDPOINT_URL', '').strip():
if backend == 'endpoint' and not env.get(
'MLC_HOTPOTQA_ENDPOINT_URL', '').strip():
return {'return': 1,
'error': 'endpoint backend requires --endpoint (MLC_HOTPOTQA_ENDPOINT_URL)'}

# The workload is executed by the benchmark-program posthook dependency.
python_bin = env.get('MLC_PYTHON_BIN_WITH_PATH', 'python3')
script = os.path.join(env['MLC_TMP_CURRENT_SCRIPT_PATH'], 'src', 'run_hotpotqa.py')
script = os.path.join(
env['MLC_TMP_CURRENT_SCRIPT_PATH'],
'src',
'run_hotpotqa.py')
env['MLC_RUN_CMD'] = f'{python_bin} "{script}"'
if not env.get('MLC_RUN_DIR', ''):
env['MLC_RUN_DIR'] = os.getcwd()
Expand Down Expand Up @@ -40,5 +44,6 @@ def postprocess(i):
env['MLC_HOTPOTQA_F1'] = str(data.get('f1', ''))
state['mlc_hotpotqa'] = data

logger.info(f"HotpotQA EM: {data.get('exact_match')}, F1: {data.get('f1')}")
logger.info(
f"HotpotQA EM: {data.get('exact_match')}, F1: {data.get('f1')}")
return {'return': 0}
11 changes: 9 additions & 2 deletions script/app-kratos/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ def preprocess(i):
def postprocess(i):
env = i['env']
src_path = env.get('MLC_KRATOS_SRC_PATH', '')
hits = glob.glob(os.path.join(src_path, 'build', '**', 'libKratosCore*'), recursive=True)
hits = glob.glob(
os.path.join(
src_path,
'build',
'**',
'libKratosCore*'),
recursive=True)
if not hits:
return {'return': 1, 'error': f'Kratos core library not found under {src_path}'}
return {'return': 1,
'error': f'Kratos core library not found under {src_path}'}
bin_dir = os.path.dirname(hits[0])
env['MLC_KRATOS_INSTALL_PATH'] = os.path.join(src_path, 'build')
env['MLC_KRATOS_BIN_PATH'] = bin_dir
Expand Down
3 changes: 2 additions & 1 deletion script/app-lammps/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def postprocess(i):

lmp_bin = os.path.join(bin_dir, 'lmp')
if not os.path.isfile(lmp_bin):
return {'return': 1, 'error': f'LAMMPS binary (lmp) not found in {bin_dir}'}
return {'return': 1,
'error': f'LAMMPS binary (lmp) not found in {bin_dir}'}

env['MLC_LAMMPS_BIN_PATH'] = bin_dir
env['MLC_LAMMPS_INSTALL_PATH'] = install_dir
Expand Down
3 changes: 2 additions & 1 deletion script/app-ls-dyna/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def postprocess(i):
install_dir = os.path.join(src_path, 'install')
env['MLC_LS_DYNA_INSTALL_PATH'] = install_dir
bin_dir = os.path.join(install_dir, 'bin')
env['MLC_LS_DYNA_BIN_PATH'] = bin_dir if os.path.isdir(bin_dir) else src_path
env['MLC_LS_DYNA_BIN_PATH'] = bin_dir if os.path.isdir(
bin_dir) else src_path
if os.path.isdir(bin_dir):
env['+PATH'] = [bin_dir]
return {'return': 0}
Loading
Loading