Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cice.setup: allow command line to override suite options #745

Merged
Merged
Show file tree
Hide file tree
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
33 changes: 12 additions & 21 deletions cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ EOF
set bfbcomp_tmp = `echo $line | cut -d' ' -f5`

# Append sets from .ts file to the $sets variable
set sets = "$sets_base,$sets_tmp"
set sets = "$sets_tmp,$sets_base"

# Create a new bfbcomp_base variable to store bfbcomp passed to cice.setup
# Use bfbcomp_base or bfbcomp_tmp
Expand Down Expand Up @@ -761,14 +761,23 @@ EOF
if (${docase} == 0) then
set soptions = ""
# Create sorted array and remove duplicates and "none"
set setsarray = `echo ${sets} | sed 's/,/ /g' | fmt -1 | sort -u`
set setsarray = `echo ${sets_tmp} | sed 's/,/ /g' | fmt -1 | sort -u`
if ("${setsarray}" != "") then
foreach field (${setsarray})
if (${field} != "none") then
set soptions = ${soptions}"_"${field}
endif
end
endif
# Add options from command line, sort and remove duplicates
set soptions_base = ""
set setsarray_base = `echo ${sets_base} | sed 's/,/ /g' | fmt -1 | sort -u`
if ("${setsarray_base}" != "") then
foreach field (${setsarray_base})
set soptions = ${soptions}"_"${field}
set soptions_base = ${soptions_base}"_"${field}
end
endif
# soptions starts with _
set testname_noid = "${machcomp}_${test}_${grid}_${pesx}${soptions}"
set testname_base = "${machcomp}_${test}_${grid}_${pesx}${soptions}.${testid}"
Expand All @@ -777,26 +786,8 @@ EOF

if (${dosuite} == 1) then
# Add -s flags in cice.setup to bfbcomp name
# Parse bfbcomp test_grid_pes and sets
# Add sets_base and sort unique
# Create fbfbcomp string that should be consistent with base casename
set bfbcomp_regex="\(.*_[0-9x]*\)_\(.*\)"
set bfbcomp_test_grid_pes=`echo ${bfbcomp} | sed "s/${bfbcomp_regex}/\1/"`
set bfbcomp_sets=`echo ${bfbcomp} | sed "s/${bfbcomp_regex}/\2/" | sed 's/_/,/g' `
set bfbcomp_sets="${bfbcomp_sets},${sets_base}"
set bfbcomp_soptions = ""
# Create sorted array and remove duplicates and "none"
set bfbcomp_setsarray = `echo ${bfbcomp_sets} | sed 's/,/ /g' | fmt -1 | sort -u`
if ("${bfbcomp_setsarray}" != "") then
foreach field (${bfbcomp_setsarray})
if (${field} != "none") then
set bfbcomp_soptions = ${bfbcomp_soptions}"_"${field}
endif
end
endif
set fbfbcomp = ${spval}
if ($bfbcomp != ${spval}) then
set fbfbcomp = ${machcomp}_${bfbcomp_test_grid_pes}${bfbcomp_soptions}
set fbfbcomp = ${machcomp}_${bfbcomp}${soptions_base}
endif
endif
endif
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ If a user adds ``--set`` to the suite, all tests in that suite will add that opt

./cice.setup --suite base_suite,decomp_suite --mach wolf --env gnu --testid myid -s debug

The option settings defined in the suite have precendence over the command line
The option settings defined at the command line have precedence over the test suite
values if there are conflicts.

The predefined test suites are defined under **configuration/scripts/tests** and
Expand Down Expand Up @@ -474,7 +474,7 @@ Test Suite Examples
./results.csh

If there are conflicts between the ``--set`` options in the suite and on the command line,
the suite will take precedence.
the command line options will take precedence.

5) **Multiple test suites from a single command line**

Expand Down