Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace run_cmd with run_shell_cmd in custom easyblock for Amber (amber.py) #3094

Merged
merged 2 commits into from
Jan 29, 2024
Merged
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
26 changes: 13 additions & 13 deletions easybuild/easyblocks/a/amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.modules import get_software_root
from easybuild.tools.run import run_cmd
from easybuild.tools.run import run_shell_cmd
from easybuild.tools.filetools import remove_dir, which


Expand Down Expand Up @@ -107,7 +107,7 @@ def patch_step(self, *args, **kwargs):
# he or she selects "latest". (Note: "latest" is not
# recommended for this reason and others.)
for _ in range(self.cfg['patchruns']):
run_cmd(cmd, log_all=True)
run_shell_cmd(cmd)
else:
for (tree, patch_level) in zip(['AmberTools', 'Amber'], self.cfg['patchlevels']):
if patch_level == 0:
Expand All @@ -116,7 +116,7 @@ def patch_step(self, *args, **kwargs):
# Run as many times as specified. It is the responsibility
# of the easyconfig author to get this right.
for _ in range(self.cfg['patchruns']):
run_cmd(cmd, log_all=True)
run_shell_cmd(cmd)

super(EB_Amber, self).patch_step(*args, **kwargs)

Expand Down Expand Up @@ -304,18 +304,18 @@ def configuremake_install_step(self):
for flag, testrule in build_targets:
# configure
cmd = "%s ./configure %s" % (self.cfg['preconfigopts'], ' '.join(common_configopts + [flag, comp_str]))
(out, _) = run_cmd(cmd, log_all=True, simple=False)
run_shell_cmd(cmd)

# build in situ using 'make install'
# note: not 'build'
super(EB_Amber, self).install_step()

# test
if self.cfg['runtest']:
run_cmd("make %s" % testrule, log_all=True, simple=False)
run_shell_cmd("make %s" % testrule)

# clean, overruling the normal 'build'
run_cmd("make clean")
run_shell_cmd("make clean")

def install_step(self):
"""Install procedure for Amber."""
Expand All @@ -332,24 +332,24 @@ def install_step(self):
pretestcommands = 'source %s/amber.sh && cd %s' % (self.installdir, self.builddir)

# serial tests
run_cmd("%s && make test.serial" % pretestcommands, log_all=True, simple=True)
run_shell_cmd("%s && make test.serial" % pretestcommands)
if self.with_cuda:
(out, ec) = run_cmd("%s && make test.cuda_serial" % pretestcommands, log_all=True, simple=False)
if ec > 0:
res = run_shell_cmd("%s && make test.cuda_serial" % pretestcommands)
if res.exit_code > 0:
self.log.warning("Check the output of the Amber cuda tests for possible failures")

if self.with_mpi:
# Hard-code parallel tests to use 4 threads
env.setvar("DO_PARALLEL", self.toolchain.mpi_cmd_for('', 4))
(out, ec) = run_cmd("%s && make test.parallel" % pretestcommands, log_all=True, simple=False)
if ec > 0:
res = run_shell_cmd("%s && make test.parallel" % pretestcommands)
if res.exit_code > 0:
self.log.warning("Check the output of the Amber parallel tests for possible failures")

if self.with_mpi and self.with_cuda:
# Hard-code CUDA parallel tests to use 2 threads
env.setvar("DO_PARALLEL", self.toolchain.mpi_cmd_for('', 2))
(out, ec) = run_cmd("%s && make test.cuda_parallel" % pretestcommands, log_all=True, simple=False)
if ec > 0:
res = run_shell_cmd("%s && make test.cuda_parallel" % pretestcommands)
if res.exit_code > 0:
self.log.warning("Check the output of the Amber cuda_parallel tests for possible failures")

def sanity_check_step(self):
Expand Down
Loading