Skip to content

Commit

Permalink
Add ICE_MEMUSE cice.settings flag for batch memory use
Browse files Browse the repository at this point in the history
Add set_env.memsmall, memmed, memlarge options
To use, will require changes to the env machine files.  Most machines will probably not use it.
See CICE-Consortium#674.
  • Loading branch information
apcraig committed Aug 8, 2022
1 parent 58e3b8f commit 3b0d98d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
18 changes: 17 additions & 1 deletion configuration/scripts/cice.batch.csh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ if ($?ICE_MACHINE_MAXRUNLENGTH) then
endif
endif

set memuse = ${ICE_MEMUSE}
if ($?ICE_MACHINE_MAXMEMUSE) then
if (${memuse} > ${ICE_MACHINE_MAXMEMUSE}) then
set memuse = ${ICE_MACHINE_MAXMEMUSE}
endif
endif

set queue = "${ICE_QUEUE}"
set batchtime = "00:15:00"
if (${runlength} == 0) set batchtime = "00:29:00"
Expand All @@ -46,6 +53,15 @@ if (${runlength} == 5) set batchtime = "5:00:00"
if (${runlength} == 6) set batchtime = "6:00:00"
if (${runlength} == 7) set batchtime = "7:00:00"
if (${runlength} >= 8) set batchtime = "8:00:00"
set batchmem = "5"
if (${memuse} == 1) set batchmem = "5"
if (${memuse} == 2) set batchmem = "10"
if (${memuse} == 3) set batchmem = "15"
if (${memuse} == 4) set batchmem = "20"
if (${memuse} == 5) set batchmem = "50"
if (${memuse} == 6) set batchmem = "100"
if (${memuse} == 7) set batchmem = "150"
if (${memuse} >= 8) set batchmem = "200"

set shortcase = `echo ${ICE_CASENAME} | cut -c1-15`

Expand Down Expand Up @@ -284,7 +300,7 @@ cat >> ${jobfile} << EOFB
#SBATCH --nodes ${nnodes}
#SBATCH --ntasks ${ntasks}
#SBATCH --cpus-per-task ${nthrds}
#SBATCH --mem-per-cpu=5G
#SBATCH --mem-per-cpu=${batchmem}G
#SBATCH --comment="image=eccc/eccc_all_default_ubuntu-18.04-amd64_latest"
EOFB

Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/cice.settings
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ setenv ICE_BFBCOMP undefined
setenv ICE_BFBTYPE restart
setenv ICE_SPVAL undefined
setenv ICE_RUNLENGTH -1
setenv ICE_MEMUSE -1
setenv ICE_ACCOUNT undefined
setenv ICE_QUEUE undefined

Expand Down
2 changes: 2 additions & 0 deletions configuration/scripts/options/set_env.memlarge
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setenv ICE_MEMUSE 8

2 changes: 2 additions & 0 deletions configuration/scripts/options/set_env.memmed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setenv ICE_MEMUSE 4

2 changes: 2 additions & 0 deletions configuration/scripts/options/set_env.memsmall
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setenv ICE_MEMUSE 1

0 comments on commit 3b0d98d

Please sign in to comment.