diff --git a/cime_config/cesm/machines/config_batch.xml b/cime_config/cesm/machines/config_batch.xml index 43c9c328c59..8780c267bcd 100644 --- a/cime_config/cesm/machines/config_batch.xml +++ b/cime_config/cesm/machines/config_batch.xml @@ -69,7 +69,8 @@ - + + @@ -142,21 +143,21 @@ - + -S {{ shell }} - + -S {{ shell }} - + -S {{ shell }} @@ -186,14 +187,14 @@ - + -S {{ shell }} - - + + ^(\d+) -A $PROJECT @@ -201,10 +202,10 @@ -l nodes={{ num_nodes }} -S {{ shell }} - + - + -S {{ shell }} @@ -232,14 +233,6 @@ - - - - -l nodes={{ num_nodes }}:ppn={{ tasks_per_node }} - -S {{ shell }} - - - @@ -253,7 +246,7 @@ - + #MSUB -A ees @@ -261,20 +254,6 @@ - - - - -S {{ shell }} - - - - - - - -S {{ shell }} - - - default @@ -361,7 +340,7 @@ - + ^(\S+) -W group_list=$PROJECT @@ -372,7 +351,7 @@ - + #MSUB @@ -431,7 +410,7 @@ - + -S {{ shell }} diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index 2ce59cd1f9a..151fb451a9e 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -789,18 +789,17 @@ 8 TRUE - /usr/bin/runjob + /usr/bin/runjob --label short - -p {{ tasks_per_node }} + --ranks-per-node $PES_PER_NODE - -n {{ num_tasks }} - $LOCARGS + --np $TOTALPES + --block $COBALT_PARTNAME --envs OMP_WAIT_POLICY=active --envs BG_SMP_FAST_WAKEUP=yes $LOCARGS --envs BG_THREADLAYOUT=1 --envs OMP_STACKSIZE=32M --envs OMP_NUM_THREADS={{ thread_count }} - : diff --git a/utils/python/CIME/XML/machines.py b/utils/python/CIME/XML/machines.py index 2e36d3f40cc..5c861ca1311 100644 --- a/utils/python/CIME/XML/machines.py +++ b/utils/python/CIME/XML/machines.py @@ -337,7 +337,10 @@ def get_full_mpirun(self, check_members, case, job): executable, args = self.get_mpirun(mpi_attribs, check_members, case, job) mpi_arg_string = " ".join(args.values()) - + batch_system = self.get_value("BATCH_SYSTEM") + if batch_system == "cobalt": + mpi_arg_string += " : " + return "%s %s %s" % (executable if executable is not None else "", mpi_arg_string, default_run_suffix) def print_values(self): diff --git a/utils/python/CIME/build.py b/utils/python/CIME/build.py index 9705245b4d6..433570ed6fd 100644 --- a/utils/python/CIME/build.py +++ b/utils/python/CIME/build.py @@ -7,7 +7,6 @@ from CIME.XML.env_mach_specific import EnvMachSpecific from CIME.preview_namelists import preview_namelists from CIME.check_input_data import check_input_data - import glob, shutil, time, threading, gzip logger = logging.getLogger(__name__) @@ -94,10 +93,11 @@ def build_model(case, build_threaded, exeroot, clm_config_opts, incroot, complis file_build = os.path.join(exeroot, "%s.bldlog.%s" % (cime_model, lid)) config_dir = os.path.join(cimeroot, "driver_cpl", "cime_config") - stat = run_cmd("%s/buildexe %s %s %s >> %s 2>&1" % - (config_dir, caseroot, bldroot, libroot, file_build), - from_dir=bldroot, ok_to_fail=True, verbose=True)[0] - + f = open(file_build, "w") + stat = run_cmd("%s/buildexe %s %s %s" % + (config_dir, caseroot, bldroot, libroot), + from_dir=bldroot, ok_to_fail=True, verbose=True, arg_stdout=f)[0] + f.close() expect(stat == 0, "ERROR: buildexe failed, cat %s" % file_build) # Copy the just-built ${MODEL}.exe to ${MODEL}.exe.$LID @@ -493,14 +493,13 @@ def build_libraries(case, exeroot, caseroot, cimeroot, libroot, mpilib, lid, mac os.makedirs(full_lib_path) file_build = os.path.join(sharedpath, "%s.bldlog.%s" % (lib, lid)) + my_file = os.path.join(os.path.dirname(machines_file), "buildlib.%s" % lib) with open(file_build, "w") as fd: fd.write("Current env:\n%s" % "\n".join([" %s = %s" % (env, os.environ[env]) for env in sorted(os.environ)])) - - my_file = os.path.join(os.path.dirname(machines_file), "buildlib.%s" % lib) - stat = run_cmd("%s %s %s >> %s 2>&1" % - (my_file, sharedpath, caseroot, file_build), + stat = run_cmd("%s %s %s" % + (my_file, sharedpath, caseroot), from_dir=exeroot, - ok_to_fail=True, verbose=True)[0] + ok_to_fail=True, verbose=True, arg_stdout=fd)[0] expect(stat == 0, "ERROR: buildlib.%s failed, cat %s" % (lib, file_build)) logs.append(file_build) @@ -528,10 +527,11 @@ def build_libraries(case, exeroot, caseroot, cimeroot, libroot, mpilib, lid, mac def _build_model_thread(config_dir, compclass, caseroot, bldroot, libroot, incroot, file_build, thread_bad_results): ############################################################################### + with open(file_build, "w") as fd: + stat = run_cmd("%s/buildlib %s %s %s " % + (config_dir, caseroot, bldroot, libroot), + from_dir=bldroot, ok_to_fail=True,verbose=True, arg_stdout=fd)[0] - stat = run_cmd("%s/buildlib %s %s %s >> %s 2>&1" % - (config_dir, caseroot, bldroot, libroot, file_build), - from_dir=bldroot, ok_to_fail=True,verbose=True)[0] if (stat != 0): thread_bad_results.append("ERROR: %s.buildlib failed, see %s" % (compclass, file_build)) diff --git a/utils/python/CIME/utils.py b/utils/python/CIME/utils.py index 7aa6d82d760..f0b3da9baa5 100644 --- a/utils/python/CIME/utils.py +++ b/utils/python/CIME/utils.py @@ -165,7 +165,8 @@ def run_cmd(cmd, ok_to_fail=False, input_str=None, from_dir=None, verbose=None, if (arg_stdout is _hack): arg_stdout = subprocess.PIPE if (arg_stderr is _hack): - arg_stderr = subprocess.PIPE + arg_stderr = subprocess.STDOUT + if (verbose or logger.level == logging.DEBUG): logger.info("RUN: %s" % cmd) @@ -198,13 +199,8 @@ def run_cmd(cmd, ok_to_fail=False, input_str=None, from_dir=None, verbose=None, if (ok_to_fail): return stat, output, errput else: - if (arg_stderr is not None): - errput = errput if errput is not None else open(arg_stderr.name, "r").read() - expect(stat == 0, "Command: '%s' failed with error '%s'%s" % - (cmd, errput, "" if from_dir is None else " from dir '%s'" % from_dir)) - else: - expect(stat == 0, "Command: '%s' failed%s. See terminal output" % - (cmd, "" if from_dir is None else " from dir '%s'" % from_dir)) + expect(stat == 0, "Command: '%s' failed%s. See terminal output" % + (cmd, "" if from_dir is None else " from dir '%s'" % from_dir)) return output def check_minimum_python_version(major, minor):