Skip to content

Commit

Permalink
Merge pull request #8 from jedwards4b/mvertens/refactor
Browse files Browse the repository at this point in the history
Mvertens/refactor
  • Loading branch information
mvertens committed Sep 9, 2015
2 parents 72a151d + 708ffde commit 6e90c29
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
1 change: 1 addition & 0 deletions cime_config/cesm/machines/config_batch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<!-- <directive> -j oe {{ output_error_path }} </directive> -->
<directive> -j oe </directive>
<directive default="ae" > -m {{ mail_options }} </directive>
<directive> -V </directive>
</directives>
</batch_system>

Expand Down
8 changes: 6 additions & 2 deletions cime_config/cesm/machines/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,13 @@
<!-- pbs is for crays.. -->
<batch_system type="pbs" version="x.y">
<queues>
<queue walltimemax="00:30:00" jobmin="1" jobmax="512" default="true">debug</queue>
<queue walltimemax="48:00:00" jobmin="1" jobmax="16368" >regular</queue>
<queue walltimemax="36:00:00" jobmin="98304" jobmax="49152" >regular</queue>
<queue walltimemax="12:00:00" jobmin="98305" jobmax="131088" default="true">regular</queue>
<queue walltimemax="00:30:00" jobmin="1" jobmax="512">debug</queue>
</queues>
<walltimes>
<walltime default="true">01:15:00</walltime>
<walltime default="true">00:30:00</walltime>
<walltime ccsm_estcost="1">01:50:00</walltime>
<walltime ccsm_estcost="3">05:00:00</walltime>
</walltimes>
Expand Down Expand Up @@ -999,6 +1002,7 @@
<SUPPORTED_BY> mickelso -at- mcs.anl.gov</SUPPORTED_BY>
<GMAKE_J>4</GMAKE_J>
<MAX_TASKS_PER_NODE>64</MAX_TASKS_PER_NODE>
<PES_PER_NODE>8</PES_PER_NODE>
<PROJECT_REQUIRED>TRUE</PROJECT_REQUIRED>
<batch_system type="cobalt">
<queues>
Expand Down
16 changes: 8 additions & 8 deletions scripts/Testing/Testcases/PET_build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,35 @@ set NTHRDS_CPL = `./xmlquery NTHRDS_CPL -value`

if ( $NTHRDS_ATM <= 1) then
echo "WARNING: component ATM is not threaded, changing NTHRDS_ATM to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_ATM -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_ATM -val 2
endif
if ( $NTHRDS_LND <= 1) then
echo "WARNING: component LND is not threaded, changing NTHRDS_LND to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_LND -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_LND -val 2
endif
if ( $NTHRDS_ROF <= 1) then
echo "WARNING: component ROF is not threaded, changing NTHRDS_ROF to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_ROF -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_ROF -val 2
endif
if ( $NTHRDS_ICE <= 1) then
echo "WARNING: component ICE is not threaded, changing NTHRDS_ICE to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_ICE -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_ICE -val 2
endif
if ( $NTHRDS_OCN <= 1) then
echo "WARNING: component OCN is not threaded, changing NTHRDS_OCN to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_OCN -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_OCN -val 2
endif
if ( $NTHRDS_GLC <= 1) then
echo "WARNING: component GLC is not threaded, changing NTHRDS_GOC to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_GLC -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_GLC -val 2
endif
if ( $NTHRDS_CPL <= 1) then
echo "WARNING: component CPL is not threaded, changing NTHRDS_CPL to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_CPL -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_CPL -val 2
endif
if ( $NTHRDS_WAV <= 1) then
echo "WARNING: component WAV is not threaded, changing NTHRDS_WAV to 2"
xmlchange -file env_mach_pes.xml -id NTHRDS_WAV -val 2
./xmlchange -file env_mach_pes.xml -id NTHRDS_WAV -val 2
endif

cp -f env_mach_pes.xml env_mach_pes.xml.1
Expand Down
5 changes: 3 additions & 2 deletions scripts/create_test
Original file line number Diff line number Diff line change
Expand Up @@ -1392,13 +1392,13 @@ sub testcaseSetup
#&Debug("XMLVARS:");
#&Debug( eval { Dumper \%xmlvars} );

chdir($caseroot);

my $cwd = getcwd();
chdir ($caseroot);
foreach my $attr(keys %xmlvars)
{
&Debug("attr $attr $xmlvars{$attr}\n");
$xmlvars{$attr} = SetupTools::expand_xml_var($xmlvars{$attr}, \%xmlvars);
&Debug("setting $xmlvars{$attr}\n");
}
chdir ($cwd);

Expand All @@ -1419,6 +1419,7 @@ sub testcaseSetup
}

print "Setting up test case \n";
chdir ($caseroot);
$sysmod = "./case_setup";
&Debug("sysmod is $sysmod");
system($sysmod) == 0 or warn "$sysmod failed: $?\n";
Expand Down
11 changes: 8 additions & 3 deletions utils/perl5lib/Config/SetupTools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ sub expand_env
{
my ($value, $xmlvars_ref) = @_;

if ($value =~ /\$ENV\{*([\w_]+)}*(.*)$/) {
if ($value =~ /\$\{*([\w_]+)}*(.*)$/) {
my $subst = $xmlvars_ref->{$1};
$subst = $ENV{$1} unless defined $subst;
$value =~ s/\$ENV\{*${1}\}*/$subst/g;
$value =~ s/\$\{*${1}\}*/$subst/g;
}

if ($value =~ /\$ENV\{*[\w_]+\}*.*$/) {
if ($value =~ /\$\{*[\w_]+\}*.*$/) {
$value = expand_env($value, $xmlvars_ref)
}
return $value;
Expand All @@ -68,6 +68,11 @@ sub expand_xml_var
{
my ($value, $xmlvars_ref) = @_;

if($value =~ /\$ENV\{(.*)\}/){
my $subst = $ENV{$1};
die "No environment variable found for $1" unless(defined $subst);
$value =~ s/\$ENV\{*${1}\}/$subst/g;
}
if ($value =~ /\$\{*([\w_]+)}*(.*)$/) {
my $found_xml;
while ( my ($key, $subst) = each(%$xmlvars_ref) ) {
Expand Down

0 comments on commit 6e90c29

Please sign in to comment.