Skip to content

Commit

Permalink
Fix submodule checkout in bisect utility
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Jul 19, 2024
1 parent 4e89091 commit d5431a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions utils/bisect/bisect_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import subprocess


def run(launch_path, mpas_path, work_base, load_script, make_command,
setup_command, run_command):
def run(launch_path, e3sm_path, mpas_path, work_base, load_script,
make_command, setup_command, run_command):
"""
This function runs a single step in the bisection process. It is typically
called through ``git bisect run`` within the ``utils/bisect/bisect.py`` but
Expand All @@ -19,6 +19,8 @@ def run(launch_path, mpas_path, work_base, load_script, make_command,
The path from which relative paths in the config file are defined,
typically the root of the polaris branch where the config file
resides and where ``utils/bisect/bisect.py`` was called.
e3sm_path : str
The relative or absolute path to the e3sm branch to build from.
mpas_path : str
The relative or absolute path to the mpas component to be built.
work_base : str
Expand All @@ -38,6 +40,7 @@ def run(launch_path, mpas_path, work_base, load_script, make_command,
test case(s)
"""

e3sm_path = to_abs(e3sm_path, launch_path)
mpas_path = to_abs(mpas_path, launch_path)
work_base = to_abs(work_base, launch_path)
load_script = to_abs(load_script, launch_path)
Expand All @@ -55,10 +58,12 @@ def run(launch_path, mpas_path, work_base, load_script, make_command,
except FileExistsError:
pass

os.chdir(mpas_path)
commands = f'source {load_script} && ' \
f'cd {e3sm_path} && ' \
f'rm -rf * && ' \
f'git reset --hard HEAD && ' \
f'git submodule update --init --recursive && ' \
f'make clean >& {work_path}/clean.log && ' \
f'cd {mpas_path} && ' \
f'{make_command} >& {work_path}/make.log && ' \
f'{setup_command} -p {mpas_path} -w {work_path} && ' \
f'cd {work_path} && ' \
Expand Down Expand Up @@ -112,7 +117,8 @@ def main():
launch_path = os.path.dirname(args.config_file)

section = config['bisect']
run(launch_path=launch_path, mpas_path=section['mpas_path'],
run(launch_path=launch_path, e3sm_path=section['e3sm_path'],
mpas_path=section['mpas_path'],
work_base=section['work_base'], load_script=section['load_script'],
make_command=section['make_command'],
setup_command=section['setup_command'],
Expand Down
2 changes: 1 addition & 1 deletion utils/bisect/example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ setup_command = polaris setup --copy_executable -n 39 -b /lcrc/group/e3sm/ac.xyl
# polaris environment
load_script = load_polaris_bisect_anvil_intel_impi.sh
# the command to run polaris within the work directory
run_command = polaris run
run_command = polaris serial

0 comments on commit d5431a5

Please sign in to comment.