Skip to content
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
29 changes: 25 additions & 4 deletions easybuild/easyblocks/h/hpcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,27 @@ def configure_step(self):
arg = "MPI_GCC_OMP"
else:
arg = "../setup/Make.MPI_GCC_OMP"
run_shell_cmd("../configure %s" % arg, work_dir='obj')
work_dir = os.path.join(self.cfg['start_dir'], 'obj')
cmd = ' '.join([
self.cfg['preconfigopts'],
"../configure",
arg,
self.cfg['configopts'],
])
run_shell_cmd(cmd, work_dir=work_dir)

def build_step(self):
"""Run build in build subdirectory."""
cxx = os.environ['CXX']
cxxflags = os.environ['CXXFLAGS']
cmd = "make CXX='%s' CXXFLAGS='$(HPCG_DEFS) %s -DMPICH_IGNORE_CXX_SEEK'" % (cxx, cxxflags)
run_shell_cmd(cmd, work_dir='obj')
cmd = ' '.join([
self.cfg['prebuildopts'],
"make",
f"CXX='{cxx}'",
f"CXXFLAGS='$(HPCG_DEFS) {cxxflags} -DMPICH_IGNORE_CXX_SEEK'",
self.cfg['buildopts'],
])
run_shell_cmd(cmd, work_dir=os.path.join(self.cfg['start_dir'], 'obj'))

def test_step(self):
"""Custom built-in test procedure for HPCG."""
Expand All @@ -74,7 +87,15 @@ def test_step(self):
# obtain equivalent of 'mpirun -np 2 xhpcg'
hpcg_mpi_cmd = self.toolchain.mpi_cmd_for("xhpcg", 2)
# 2 threads per MPI process (4 threads in total)
cmd = "PATH=%s:$PATH OMP_NUM_THREADS=2 %s" % (objbindir, hpcg_mpi_cmd)
cmd = ' '.join([
self.cfg['pretestopts'],
' && '.join([
f"export PATH={objbindir}:$PATH",
"export OMP_NUM_THREADS=2",
hpcg_mpi_cmd,
]),
self.cfg['testopts'],
])
run_shell_cmd(cmd)

# find log file, check for success
Expand Down