-
Notifications
You must be signed in to change notification settings - Fork 183
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
Eliminate _gfs
, _gdas
, etc, variables and add necessary if blocks
#3420
base: develop
Are you sure you want to change the base?
Eliminate _gfs
, _gdas
, etc, variables and add necessary if blocks
#3420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct?
_gfs
, _gdas
, etc, variables and replace them with if blocks_gfs
, _gdas
, etc, variables and add necessary if blocks
parm/config/gefs/config.resources
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think lines 355-364 should be deleted as part of this as well. If all of the _RUN
variables are deleted, there should be no need for it.
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=1 | ||
export layout_y=1 | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | ||
fi | ||
export layout_x=1 | ||
export layout_y=1 | ||
export layout_x_gfs=1 | ||
export layout_y_gfs=1 | ||
export nthreads_fv3=1 | ||
export nthreads_fv3_gfs=1 | ||
export nthreads_ufs=1 | ||
export nthreads_ufs_gfs=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need a if
block here since the resources are identical for gdas
and gfs
RUNs.
if [[ "${RUN}" = *gfs ]]; then | |
export layout_x=1 | |
export layout_y=1 | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | |
fi | |
export layout_x=1 | |
export layout_y=1 | |
export layout_x_gfs=1 | |
export layout_y_gfs=1 | |
export nthreads_fv3=1 | |
export nthreads_fv3_gfs=1 | |
export nthreads_ufs=1 | |
export nthreads_ufs_gfs=1 | |
export layout_x=1 | |
export layout_y=1 | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 |
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=6 | ||
export layout_y=8 | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | ||
fi | ||
export layout_x=2 | ||
export layout_y=2 | ||
export layout_x_gfs=6 | ||
export layout_y_gfs=8 | ||
export nthreads_fv3=1 | ||
export nthreads_fv3_gfs=1 | ||
export nthreads_ufs=1 | ||
export nthreads_ufs_gfs=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, no if
block needed.
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=4 | ||
export layout_y=6 | ||
export nthreads_fv3=2 | ||
export nthreads_ufs=2 | ||
export WRITE_GROUP=2 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=5 | ||
fi | ||
export DELTIM=600 | ||
export layout_x=4 | ||
export layout_y=6 | ||
export layout_x_gfs=4 | ||
export layout_y_gfs=6 | ||
export nthreads_fv3=1 | ||
export nthreads_fv3_gfs=2 | ||
export nthreads_ufs=1 | ||
export nthreads_ufs_gfs=2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, the nthreads_ufs
set in the gfs
if block is being overridden by the following lines. Suggest either having an if-else block here or declaring defaults first, then overriding with a RUN-based if block:
if [[ "${RUN}" = *gfs ]]; then | |
export layout_x=4 | |
export layout_y=6 | |
export nthreads_fv3=2 | |
export nthreads_ufs=2 | |
export WRITE_GROUP=2 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=5 | |
fi | |
export DELTIM=600 | |
export layout_x=4 | |
export layout_y=6 | |
export layout_x_gfs=4 | |
export layout_y_gfs=6 | |
export nthreads_fv3=1 | |
export nthreads_fv3_gfs=2 | |
export nthreads_ufs=1 | |
export nthreads_ufs_gfs=2 | |
export DELTIM=600 | |
export layout_x=4 | |
export layout_y=6 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | |
if [[ "${RUN}" = *gfs ]]; then | |
export nthreads_fv3=2 | |
export nthreads_ufs=2 | |
export WRITE_GROUP=2 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=5 | |
fi |
Also, lines 151-4 should be deleted.
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=8 | ||
export layout_y=8 | ||
export nthreads_fv3=2 | ||
export nthreads_ufs=2 | ||
export WRITE_GROUP=2 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | ||
fi | ||
export DELTIM=300 | ||
export layout_x=6 | ||
export layout_y=8 | ||
export layout_x_gfs=8 | ||
export layout_y_gfs=8 | ||
export nthreads_fv3=1 | ||
export nthreads_fv3_gfs=2 | ||
export nthreads_ufs=1 | ||
export nthreads_ufs_gfs=2 | ||
export cdmbgwd="1.1,0.72,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling | ||
export cdmbgwd_gsl="5.0,5.0,1.0,1.0" # settings for GSL drag suite | ||
export psl_gwd_dx_factor=6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as C192.
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=12 | ||
export layout_y=16 | ||
export nthreads_fv3=4 | ||
export nthreads_ufs=4 | ||
export WRITE_GROUP=4 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=20 #Note this should be 10 for WCOSS2 | ||
fi | ||
export DELTIM=150 | ||
export layout_x=8 | ||
export layout_y=12 | ||
export layout_x_gfs=12 | ||
export layout_y_gfs=16 | ||
export nthreads_fv3=4 | ||
export nthreads_fv3_gfs=4 | ||
export nthreads_ufs=4 | ||
export nthreads_ufs_gfs=4 | ||
export cdmbgwd="4.0,0.15,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling | ||
export cdmbgwd_gsl="2.5,7.5,1.0,1.0" # settings for GSL drag suite | ||
export psl_gwd_dx_factor=6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as C192.
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=8 | ||
export layout_y=16 | ||
export nthreads_fv3=4 | ||
export nthreads_ufs=4 | ||
export WRITE_GROUP=4 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=20 # TODO: refine these numbers when a case is available | ||
fi | ||
export DELTIM=150 | ||
export layout_x=8 | ||
export layout_y=16 | ||
export layout_x_gfs=8 | ||
export layout_y_gfs=16 | ||
export nthreads_fv3=4 | ||
export nthreads_fv3_gfs=4 | ||
export nthreads_ufs=4 | ||
export nthreads_ufs_gfs=4 | ||
export cdmbgwd="4.0,0.10,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling | ||
export cdmbgwd_gsl="1.67,8.8,1.0,1.0" # settings for GSL drag suite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as C192.
parm/config/gfs/config.resources
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
ntasks=5 | ||
memory="100GB" | ||
NTASKS=${ntasks} | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
ntasks=65 | ||
memory="150GB" | ||
NTASKS=${ntasks} | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NTASKS
could be moved after the if block:
if [[ "${RUN}" = *gdas ]]; then | |
ntasks=5 | |
memory="100GB" | |
NTASKS=${ntasks} | |
elif [[ "${RUN}" = *gfs ]]; then | |
ntasks=65 | |
memory="150GB" | |
NTASKS=${ntasks} | |
fi | |
if [[ "${RUN}" = *gdas ]]; then | |
ntasks=5 | |
memory="100GB" | |
elif [[ "${RUN}" = *gfs ]]; then | |
ntasks=65 | |
memory="150GB" | |
fi | |
NTASKS=${ntasks} |
parm/config/gfs/config.resources
Outdated
memory_gdas="20GB" | ||
memory_gfs="20GB" | ||
if [[ "${RUN}" = *gdas ]]; then | ||
walltime="00:15:00" | ||
memory="20GB" | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
walltime="00:15:00" | ||
memory="20GB" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since memory
is the same, just declare it once before the if-elif block.
parm/config/gfs/config.resources
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
ntasks=$(( layout_x * layout_y * 6 )) | ||
threads_per_task=1 | ||
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
ntasks=$(( layout_x * layout_y * 6 )) | ||
threads_per_task=1 | ||
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for an if-elif block here since the variables are all the same
if [[ "${RUN}" = *gdas ]]; then | |
ntasks=$(( layout_x * layout_y * 6 )) | |
threads_per_task=1 | |
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | |
elif [[ "${RUN}" = *gfs ]]; then | |
ntasks=$(( layout_x * layout_y * 6 )) | |
threads_per_task=1 | |
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | |
fi | |
ntasks=$(( layout_x * layout_y * 6 )) | |
threads_per_task=1 | |
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) |
parm/config/gfs/config.resources
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
ntasks=$(( layout_x * layout_y * 6 )) | ||
threads_per_task=1 | ||
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
ntasks=$(( layout_x * layout_y * 6 )) | ||
threads_per_task=1 | ||
tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
parm/config/gfs/config.resources
Outdated
_RUN=${RUN:-"gfs"} | ||
_RUN=${RUN/enkf/} | ||
RUN_NAME=${RUN:-"gfs"} | ||
RUN_NAME=${RUN/enkf/} | ||
|
||
# Declare variables from config.ufs based on _RUN | ||
# Declare variables from config.ufs based on RUN_NAME | ||
# Export layout and write task variables, but not ntasks/threads | ||
# Capitalize _RUN for write tasks | ||
# Capitalize RUN_NAME for write tasks | ||
for var in layout_x layout_y ntasks_fv3 ntasks_quilt nthreads_fv3 nthreads_ufs \ | ||
WRITE_GROUP WRTTASK_PER_GROUP_PER_THREAD; do | ||
if [[ ${var} =~ "layout" ]]; then | ||
ufs_var_name="${var}_${_RUN}" | ||
ufs_var_name="${var}_${RUN_NAME}" | ||
declare -x "${var}"="${!ufs_var_name}" | ||
elif [[ ${var} =~ "WR" ]]; then | ||
ufs_var_name="${var}_${_RUN^^}" | ||
ufs_var_name="${var}_${RUN_NAME^^}" | ||
declare -x "${var}"="${!ufs_var_name}" | ||
else | ||
ufs_var_name="${var}_${_RUN}" | ||
ufs_var_name="${var}_${RUN_NAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this block is required anymore.
parm/config/gfs/config.resources
Outdated
exit 4 | ||
;; | ||
esac | ||
if [[ "${RUN}" =~ gdas ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
will capture both gdas
and enkfgdas
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just be == gdas
.
parm/config/gfs/config.resources
Outdated
elif [[ "${RUN}" =~ enkfgdas ]]; then | ||
case "${CASE}" in | ||
"C48" | "C96" | "C192") | ||
declare -x "walltime"="00:20:00" | ||
;; | ||
"C384") | ||
declare -x "walltime"="00:30:00" | ||
;; | ||
*) | ||
echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" | ||
exit 4 | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enkfgdas
and enkfgfs
if blocks can be combined.
parm/config/gfs/config.resources
Outdated
|
||
unset _RUN | ||
unset RUN_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unset RUN_NAME |
export ntasks_gdas=270 | ||
export ntasks_gfs=270 | ||
if [[ "${RUN}" = *gdas ]]; then | ||
export ntasks=270 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export ntasks=270 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just ntasks=270 should suffice.
if [[ "${RUN}" = *gdas ]]; then | ||
export tasks_per_node=12 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export tasks_per_node=12 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
if [[ "${RUN}" = *gdas ]]; then | ||
export tasks_per_node=48 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export tasks_per_node=48 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
if [[ "${RUN}" = *gdas ]]; then | ||
export tasks_per_node=8 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export tasks_per_node=8 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
parm/config/gfs/config.resources.S4
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
export ntasks=416 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export ntasks=416 | ||
fi | ||
fi | ||
#S4 is small, so run this task with just 1 thread | ||
export threads_per_task=1 | ||
export walltime_gdas="02:00:00" | ||
export walltime_gfs="02:00:00" | ||
if [[ "${RUN}" = *gdas ]]; then | ||
export walltime="02:00:00" | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export walltime="02:00:00" | ||
fi | ||
;; | ||
"C192" | "C96" | "C48") | ||
export threads_per_task=4 | ||
if [[ ${PARTITION_BATCH} == "s4" ]]; then | ||
export ntasks_gdas=88 | ||
export ntasks_gfs=88 | ||
if [[ "${RUN}" = *gdas ]]; then | ||
export ntasks=88 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export ntasks=88 | ||
fi | ||
elif [[ ${PARTITION_BATCH} == "ivy" ]]; then | ||
export ntasks_gdas=90 | ||
export ntasks_gfs=90 | ||
if [[ "${RUN}" = *gdas ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
if [[ "${RUN}" = *gdas ]]; then | ||
export tasks_per_node=48 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export tasks_per_node=48 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments on the GEFS config.ufs
.
parm/config/gefs/config.ufs
Outdated
if [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=6 | ||
export layout_y=8 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this shouldn't be needed in GEFS since the only RUN
is gefs
.
if [[ "${RUN}" = *gfs ]]; then | |
export layout_x=6 | |
export layout_y=8 | |
fi |
export ntasks=270 | ||
export threads_per_task=8 | ||
export tasks_per_node=$(( max_tasks_per_node / threads_per_task )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indents:
export ntasks=270 | |
export threads_per_task=8 | |
export tasks_per_node=$(( max_tasks_per_node / threads_per_task )) | |
export ntasks=270 | |
export threads_per_task=8 | |
export tasks_per_node=$(( max_tasks_per_node / threads_per_task )) |
parm/config/gfs/config.ufs
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
export layout_x=1 | ||
export layout_y=1 | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=1 | ||
export layout_y=1 | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are identical, there's no need for an if-else:
if [[ "${RUN}" = *gdas ]]; then | |
export layout_x=1 | |
export layout_y=1 | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | |
elif [[ "${RUN}" = *gfs ]]; then | |
export layout_x=1 | |
export layout_y=1 | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | |
fi | |
export layout_x=1 | |
export layout_y=1 | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 |
parm/config/gfs/config.ufs
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export layout_x=2 | ||
export layout_y=2 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export layout_x=2 | ||
export layout_y=2 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are the same, there's no need for an if-elif block:
if [[ "${RUN}" = *gdas ]]; then | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export layout_x=2 | |
export layout_y=2 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | |
elif [[ "${RUN}" = *gfs ]]; then | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export layout_x=2 | |
export layout_y=2 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 | |
fi | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export layout_x=2 | |
export layout_y=2 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=1 |
;; | ||
"C96") | ||
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then | ||
if [[ "${RUN}" = *gdas ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aerorahul I am unsure of how nesting works. Should there be gdas
, gfs
, and nest
grids, threading, write tasks, etc? Or only gfs
and nest
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure either. For now, let us assume that DO_NEST
is only ON
for RUN=gdas
. It is possible that nesting will not be supported going forward as that project is looking elsewhere.
parm/config/gfs/config.ufs
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
export layout_x=4 | ||
export layout_y=6 | ||
export nthreads_fv3=1 | ||
export nthreads_ufs=1 | ||
export WRITE_GROUP=1 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=4 | ||
export layout_y=6 | ||
export nthreads_fv3=2 | ||
export nthreads_ufs=2 | ||
export WRITE_GROUP=2 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=5 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the layouts are the same for gdas
and gfs
RUNs, they could be pulled out of the if-elif block:
if [[ "${RUN}" = *gdas ]]; then | |
export layout_x=4 | |
export layout_y=6 | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | |
elif [[ "${RUN}" = *gfs ]]; then | |
export layout_x=4 | |
export layout_y=6 | |
export nthreads_fv3=2 | |
export nthreads_ufs=2 | |
export WRITE_GROUP=2 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=5 | |
fi | |
export layout_x=4 | |
export layout_y=6 | |
if [[ "${RUN}" = *gdas ]]; then | |
export nthreads_fv3=1 | |
export nthreads_ufs=1 | |
export WRITE_GROUP=1 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | |
elif [[ "${RUN}" = *gfs ]]; then | |
export nthreads_fv3=2 | |
export nthreads_ufs=2 | |
export WRITE_GROUP=2 | |
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=5 | |
fi |
parm/config/gfs/config.ufs
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
export layout_x=8 | ||
export layout_y=8 | ||
export nthreads_fv3=2 | ||
export nthreads_ufs=2 | ||
export WRITE_GROUP=4 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=8 | ||
export layout_y=8 | ||
export nthreads_fv3=2 | ||
export nthreads_ufs=2 | ||
export WRITE_GROUP=4 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for an if-elif block since all of the parameters are the same.
parm/config/gfs/config.ufs
Outdated
if [[ "${RUN}" = *gdas ]]; then | ||
export layout_x=16 | ||
export layout_y=10 | ||
export nthreads_fv3=2 | ||
export WRITE_GROUP=2 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=90 | ||
elif [[ "${RUN}" = *gfs ]]; then | ||
export layout_x=16 | ||
export layout_y=10 | ||
export nthreads_fv3=2 | ||
export WRITE_GROUP=2 | ||
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=90 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
Description
Following Allow APP to differ between RUNs #2943, it should now be feasible to eliminate most, if not all, variables ending in _RUN from the configuration files and scripts, while incorporating necessary if blocks. These if blocks will trigger errors, serving as an indication that something is significantly wrong. This change will simplify both the resource calculations and the workflow, including the workflow setup scripts.
Resolves Issue Eliminate _gfs _gdas, etc, variables #3000
Refs Allow APP to differ between RUNs #2943
Type of change
Change characteristics
How has this been tested?