Skip to content

Commit

Permalink
Merge branch 'master' into agsalin/merge-from-acme-03292017
Browse files Browse the repository at this point in the history
* master:
  fix for fortran unit tests
  update stubs file
  Set a default value for esmf_logging so it does not have to appear in drv_in.
  Allow a custom input root through create_test.
  Fix pylint issues
  Fixed non-ASCII character in description.
  Added log kind flag to ESMF_Initialize call
  • Loading branch information
jgfouca committed Apr 4, 2017
2 parents 03001c8 + dda631e commit 9e10abe
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 72 deletions.
6 changes: 4 additions & 2 deletions scripts/Tools/check_input_data
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
parser.add_argument("--svn-loc", default=SVN_LOCS[get_model()],
help="The input data repository from which to download data.")

parser.add_argument("-i", "--input-data-root", default=MACHINE.get_value("DIN_LOC_ROOT"),
help="The root directory where input data goes")
parser.add_argument("-i", "--input-data-root", default=None,
help="The root directory where input data goes. "
"Default value will come from DIN_LOC_ROOT from case which itself "
"defaults to '%s'" % MACHINE.get_value("DIN_LOC_ROOT"))

parser.add_argument("--data-list-dir", default="Buildconf",
help="Where to find list of input files")
Expand Down
17 changes: 12 additions & 5 deletions scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ OR
parser.add_argument("--force-threads", type=int, default=None,
help="For all tests to run with this number of threads")

parser.add_argument("-i", "--input-dir",
help="Use a non-default location for input files")

args = parser.parse_args(args[1:])

CIME.utils.handle_standard_logging_options(args)
Expand Down Expand Up @@ -343,11 +346,14 @@ OR
elif args.generate:
baseline_gen_name = baseline_name

if args.input_dir is not None:
args.input_dir = os.path.abspath(args.input_dir)

return test_names, test_extra_data, args.compiler, mach_obj.get_machine_name(), args.no_run, args.no_build, args.no_setup, args.no_batch,\
args.test_root, args.baseline_root, args.clean, baseline_cmp_name, baseline_gen_name, \
args.namelists_only, args.project, args.test_id, args.parallel_jobs, args.walltime, \
args.single_submit, args.proc_pool, args.use_existing, args.save_timing, args.queue, \
args.allow_baseline_overwrite, args.output_root, args.wait, args.force_procs, args.force_threads, args.mpilib
args.allow_baseline_overwrite, args.output_root, args.wait, args.force_procs, args.force_threads, args.mpilib, args.input_dir

###############################################################################
def single_submit_impl(machine_name, test_id, proc_pool, project, args, job_cost_map, wall_time, test_root):
Expand Down Expand Up @@ -453,7 +459,7 @@ def single_submit_impl(machine_name, test_id, proc_pool, project, args, job_cost
def create_test(test_names, test_data, compiler, machine_name, no_run, no_build, no_setup, no_batch, test_root,
baseline_root, clean, baseline_cmp_name, baseline_gen_name, namelists_only, project, test_id, parallel_jobs,
walltime, single_submit, proc_pool, use_existing, save_timing, queue, allow_baseline_overwrite, output_root, wait,
force_procs, force_threads, mpilib):
force_procs, force_threads, mpilib, input_dir):
###############################################################################
impl = TestScheduler(test_names, test_data=test_data,
no_run=no_run, no_build=no_build, no_setup=no_setup, no_batch=no_batch,
Expand All @@ -465,7 +471,8 @@ def create_test(test_names, test_data, compiler, machine_name, no_run, no_build,
project=project, parallel_jobs=parallel_jobs, walltime=walltime,
proc_pool=proc_pool, use_existing=use_existing, save_timing=save_timing,
queue=queue, allow_baseline_overwrite=allow_baseline_overwrite,
output_root=output_root, force_procs=force_procs, force_threads=force_threads, mpilib=mpilib)
output_root=output_root, force_procs=force_procs, force_threads=force_threads,
mpilib=mpilib, input_dir=input_dir)

success = impl.run_tests(wait=wait)

Expand Down Expand Up @@ -506,13 +513,13 @@ def _main_func(description):
test_names, test_data, compiler, machine_name, no_run, no_build, no_setup, no_batch, \
test_root, baseline_root, clean, baseline_cmp_name, baseline_gen_name, namelists_only, \
project, test_id, parallel_jobs, walltime, single_submit, proc_pool, use_existing, \
save_timing, queue, allow_baseline_overwrite, output_root, wait, force_procs, force_threads, mpilib \
save_timing, queue, allow_baseline_overwrite, output_root, wait, force_procs, force_threads, mpilib, input_dir \
= parse_command_line(sys.argv, description)

sys.exit(create_test(test_names, test_data, compiler, machine_name, no_run, no_build, no_setup, no_batch, test_root,
baseline_root, clean, baseline_cmp_name, baseline_gen_name, namelists_only,
project, test_id, parallel_jobs, walltime, single_submit, proc_pool, use_existing, save_timing,
queue, allow_baseline_overwrite, output_root, wait, force_procs, force_threads, mpilib))
queue, allow_baseline_overwrite, output_root, wait, force_procs, force_threads, mpilib, input_dir))

###############################################################################

Expand Down
8 changes: 3 additions & 5 deletions scripts/lib/CIME/XML/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def print_values(self, long_output=None):
self._print_values_v2(long_output=long_output)

def _print_values_v2(self, long_output=None):

logger.info("%5s-------------------------------------------------------------" %(""))
logger.info("%10s default component grids:\n" %(""))
logger.info(" component compset value " )
Expand All @@ -430,16 +430,14 @@ def _print_values_v2(self, long_output=None):
value = grid_node.text
logger.info(" %6s %15s %10s" %(name, compset, value))
logger.info("%5s-------------------------------------------------------------" %(""))

domains = {}
if long_output is not None:
domain_nodes = self.get_nodes(nodename="domain")
for domain_node in domain_nodes:
name = domain_node.get("name")
if name == 'null':
continue
nx = self.get_node("nx", root=domain_node).text
ny = self.get_node("ny", root=domain_node).text
desc = self.get_node("desc", root=domain_node).text
#support = self.get_optional_node("support", root=domain_node).text
files = ""
Expand Down Expand Up @@ -478,7 +476,7 @@ def _print_values_v2(self, long_output=None):
gridnames = []
for grid_node in grid_nodes:
gridnames.append(grid_node.text)
grids += grid_node.get("name") + ":" + grid_node.text + " "
grids += grid_node.get("name") + ":" + grid_node.text + " "
logger.info(" non-default grids are: %s" %grids)
mask_nodes = self.get_nodes("mask", root=model_grid_node)
for mask_node in mask_nodes:
Expand Down
23 changes: 14 additions & 9 deletions scripts/lib/CIME/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,18 @@ def __init__(self, test_names, test_data=None,
walltime=None, proc_pool=None,
use_existing=False, save_timing=False, queue=None,
allow_baseline_overwrite=False, output_root=None,
force_procs=None, force_threads=None, mpilib=None):
###########################################################################
self._cime_root = CIME.utils.get_cime_root()
self._cime_model = get_model()
self._save_timing = save_timing
self._queue = queue
self._test_data = {} if test_data is None else test_data # Format: {test_name -> {data_name -> data}}
self._mpilib = mpilib # allow override of default mpilib
self._allow_baseline_overwrite = allow_baseline_overwrite
force_procs=None, force_threads=None, mpilib=None, input_dir=None):
###########################################################################
self._cime_root = CIME.utils.get_cime_root()
self._cime_model = get_model()
self._save_timing = save_timing
self._queue = queue
self._test_data = {} if test_data is None else test_data # Format: {test_name -> {data_name -> data}}
self._mpilib = mpilib # allow override of default mpilib
self._completed_tests = 0
self._input_dir = input_dir

self._allow_baseline_overwrite = allow_baseline_overwrite

self._machobj = Machines(machine=machine_name)

Expand Down Expand Up @@ -531,6 +533,9 @@ def _xml_phase(self, test):
case.set_value("TEST", True)
case.set_value("SAVE_TIMING", self._save_timing)

if self._input_dir is not None:
case.set_value("DIN_LOC_ROOT", self._input_dir)

return True

###########################################################################
Expand Down
17 changes: 17 additions & 0 deletions src/drivers/mct/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,23 @@
this to work.</desc>
</entry>

<entry id="ESMF_LOGFILE_KIND">
<type>char</type>
<valid_values>ESMF_LOGKIND_SINGLE,ESMF_LOGKIND_MULTI,ESMF_LOGKIND_NONE</valid_values>
<default_value>ESMF_LOGKIND_NONE</default_value>
<group>run_cesm</group>
<file>env_run.xml</file>
<desc>
Determines what ESMF log files (if any) are generated when
USE_ESMF_LIB is TRUE.
ESMF_LOGKIND_SINGLE: Use a single log file, combining messages from
all of the PETs. Not supported on some platforms.
ESMF_LOGKIND_MULTI: Use multiple log files -- one per PET.
ESMF_LOGKIND_NONE: Do not issue messages to a log file.
By default, no ESMF log files are generated.
</desc>
</entry>

<entry id="COMP_RUN_BARRIERS">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down
18 changes: 18 additions & 0 deletions src/drivers/mct/cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,24 @@
</values>
</entry>

<entry id="esmf_logging" modify_via_xml="ESMF_LOGFILE_KIND">
<type>char</type>
<category>ccsm_pes</category>
<group>ccsm_pes</group>
<desc>
Determines what ESMF log files (if any) are generated when
USE_ESMF_LIB is TRUE.
ESMF_LOGKIND_SINGLE: Use a single log file, combining messages from
all of the PETs. Not supported on some platforms.
ESMF_LOGKIND_MULTI: Use multiple log files — one per PET.
ESMF_LOGKIND_NONE: Do not issue messages to a log file.
By default, no ESMF log files are generated.
</desc>
<values>
<value>$ESMF_LOGFILE_KIND</value>
</values>
</entry>

<!-- =========================== -->
<!-- group prof_inparm -->
<!-- in perf_mod.F90 -->
Expand Down
7 changes: 4 additions & 3 deletions src/drivers/mct/main/cesm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ program cesm_driver
!----------------------------------------------------------------------------
! share code & libs
!----------------------------------------------------------------------------
use perf_mod
use ESMF
use perf_mod, only : t_startf, t_adj_detailf, t_stopf
use ESMF, only : ESMF_Initialize, ESMF_Finalize
use seq_comm_mct, only : esmf_logfile_kind
use cesm_comp_mod, only : cesm_pre_init1
use cesm_comp_mod, only : cesm_pre_init2
use cesm_comp_mod, only : cesm_init
Expand All @@ -40,7 +41,7 @@ program cesm_driver
! because it is needed for the time manager, even if the ESMF_INTERFACE
! is not used.
!--------------------------------------------------------------------------
call ESMF_Initialize()
call ESMF_Initialize(logkindflag=esmf_logfile_kind)

!--------------------------------------------------------------------------
! Read in the configuration information and initialize the time manager.
Expand Down
Loading

0 comments on commit 9e10abe

Please sign in to comment.