Skip to content

Commit

Permalink
Get the unit test working
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Mar 27, 2024
1 parent f7842be commit 64f5a0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_simple_derecho_args(self):
check_parser_args(args)
with open(self._jobscript_file, "w", encoding="utf-8") as runfile:
attribs = write_runscript_part1(nodes, tasks, machine, self._account, runfile)
self.assertEqual({"mpilib": "default", "ncpus": 128}, attribs, msg="attribs not as expected")
self.assertEqual({"mpilib": "default"}, attribs, msg="attribs not as expected")

self.assertFileContentsEqual(self._output_compare, self._jobscript_file)

Expand Down
14 changes: 8 additions & 6 deletions python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,18 @@ def write_runscript_part1(number_of_nodes, tasks_per_node, machine, account, run
runfile.write("#PBS -k eod\n")
runfile.write("#PBS -S /bin/bash\n")
if machine == "derecho":
attribs = {"mpilib": "default", "ncpus":128}
attribs = {"mpilib": "default"}
runfile.write("#PBS -l walltime=59:00\n")
runfile.write(f"#PBS -A {account}\n")
runfile.write("#PBS -q main\n")
ncpus = attribs["ncpus"]
ncpus = 128
runfile.write(
"#PBS -l select="
+ f"{number_of_nodes}:ncpus={ncpus}:mpiprocs={tasks_per_node}\n"
)
elif machine == "casper":
attribs = {"mpilib": "default", "ncpus":36}
attribs = {"mpilib": "default"}
ncpus = 36
runfile.write("#PBS -l walltime=1:00:00\n")
runfile.write(f"#PBS -A {account}\n")
runfile.write("#PBS -q casper\n")
Expand All @@ -150,7 +151,8 @@ def write_runscript_part1(number_of_nodes, tasks_per_node, machine, account, run
f"mpiprocs={tasks_per_node}:mem=80GB\n"
)
elif machine == "izumi":
attribs = {"mpilib": "mvapich2", "ncpus":48}
attribs = {"mpilib": "mvapich2"}
ncpus = 48
runfile.write("#PBS -l walltime=2:00:00\n")
runfile.write("#PBS -q medium\n")
runfile.write(f"#PBS -l nodes={number_of_nodes}:ppn={tasks_per_node},mem=555GB -r n\n")
Expand All @@ -161,8 +163,8 @@ def write_runscript_part1(number_of_nodes, tasks_per_node, machine, account, run
runfile.write("\n")

# Make sure tasks_per_node doesn't exceed the number of cpus per node
#if tasks_per_node > attribs["ncpus"]:
#abort( "Number of tasks per node exceeds the number of processors per node on this machine" )
if tasks_per_node > ncpus:
abort( "Number of tasks per node exceeds the number of processors per node on this machine" )
return attribs

def get_mpirun( args, attribs ):
Expand Down

0 comments on commit 64f5a0c

Please sign in to comment.