Skip to content

Commit

Permalink
Remove sbatch and srun defaults from modulefile (#224)
Browse files Browse the repository at this point in the history
These override batch file settings and are only overridden by command line arguments so this isn't a good place to set defaults.

Resolves #223
  • Loading branch information
cartalla authored Apr 29, 2024
1 parent 54b6a9e commit 396fa78
Showing 1 changed file with 0 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,80 +31,6 @@ setenv SLURM_CONF {{SubmitterSlurmBaseDir}}/etc/slurm.conf

setenv SLURM_CLUSTER_NAME {{ClusterName}}

# sbatch defaults
if { [ module-info mode load ] || [ module-info mode display ] } {
if { ! [ info exists ::env(SBATCH_MEM_PER_NODE) ] } {
setenv SBATCH_MEM_PER_NODE 100M
setenv SBATCH_MEM_PER_NODE_SET ""
}
if { ! ( [ info exists ::env(SBATCH_REQUEUE) ] || [ info exists ::env(SBATCH_NO_REQUEUE) ] ) } {
setenv SBATCH_REQUEUE ""
setenv SBATCH_REQUEUE_SET ""
}
if { ! [ info exists ::env(SBATCH_TIMELIMIT) ] } {
setenv SBATCH_TIMELIMIT "1:0:0"
setenv SBATCH_TIMELIMIT_SET ""
}
if { ! [ info exists ::env(SBATCH_PARTITION) ] } {
setenv SBATCH_PARTITION "{{DefaultPartition}}"
setenv SBATCH_PARTITION_SET ""
}
} elseif { [ module-info mode remove ] } {
if { [ info exists ::env(SBATCH_MEM_PER_NODE_SET) ] } {
unsetenv SBATCH_MEM_PER_NODE
unsetenv SBATCH_MEM_PER_NODE_SET
}
if { [ info exists ::env(SBATCH_REQUEUE_SET) ] } {
unsetenv SBATCH_REQUEUE
unsetenv SBATCH_REQUEUE_SET
}
if { [ info exists ::env(SBATCH_TIMELIMIT_SET) ] } {
unsetenv SBATCH_TIMELIMIT
unsetenv SBATCH_TIMELIMIT_SET
}
if { [ info exists ::env(SBATCH_PARTITION_SET) ] } {
unsetenv SBATCH_PARTITION
unsetenv SBATCH_PARTITION_SET
}
}

# srun defaults
if { [ module-info mode load ] || [ module-info mode display ] } {
if { ! [ info exists ::env(SLURM_CPUS_PER_TASK) ] } {
setenv SLURM_CPUS_PER_TASK 1
setenv SLURM_CPUS_PER_TASK_SET ""
}
if { ! [ info exists ::env(SLURM_MEM_PER_NODE) ] } {
setenv SLURM_MEM_PER_NODE 100M
setenv SLURM_MEM_PER_NODE_SET ""
}
if { ! [ info exists ::env(SLURM_PARTITION) ] } {
setenv SLURM_PARTITION "{{DefaultPartition}}"
setenv SLURM_PARTITION_SET ""
}
if { ! [ info exists ::env(SLURM_TIMELIMIT) ] } {
setenv SLURM_TIMELIMIT "1:0:0"
setenv SLURM_TIMELIMIT_SET ""
}
} elseif { [ module-info mode remove ] } {
if { [ info exists ::env(SLURM_CPUS_PER_TASK_SET) ] } {
unsetenv SLURM_CPUS_PER_TASK
unsetenv SLURM_CPUS_PER_TASK_SET
}
if { [ info exists ::env(SLURM_MEM_PER_NODE_SET) ] } {
unsetenv SLURM_MEM_PER_NODE
unsetenv SLURM_MEM_PER_NODE_SET
}
if { ! [ info exists ::env(SLURM_PARTITION_SET) ] } {
unsetenv SLURM_PARTITION
unsetenv SLURM_PARTITION_SET
}
if { [ info exists ::env(SLURM_TIMELIMIT_SET) ] } {
unsetenv SLURM_TIMELIMIT
unsetenv SLURM_TIMELIMIT_SET
}
}

# squeue defaults
#
# Output format
Expand Down

0 comments on commit 396fa78

Please sign in to comment.