From 4703995b1e7e4060aded8dfe8ea82aeb29b38a07 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Tue, 8 Mar 2016 14:57:45 +0200 Subject: [PATCH] Only use default nodes/partitions of lists aren't defined --- templates/slurm.conf.j2 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 158b4a5..95184c8 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -133,29 +133,31 @@ AccountingStorageEnforce={{ slurm_accounting_storage_enforce }} # TOPOLOGY # #TopologyPlugin=topology/tree + # COMPUTE NODES -#NodeName={{ nodeBase }}[1-4] RealMemory=126000 Sockets=2 CoresPerSocket=6 ThreadsPerCore=1 State=UNKNOWN +{% if slurm_nodelist is defined %} +{% for nodelist in slurm_nodelist %} +{{ nodelist }} +{% endfor %} +{% else %} NodeName={{ slurm_compute_nodes }} RealMemory={{ slurm_compute_realmemory }} Sockets={{ slurm_compute_sockets }} CoresPerSocket={{ slurm_compute_corespersocket }} ThreadsPerCore={{ slurm_compute_threadspercore }} State={{ slurm_node_state }} - # If slurm_with_gpu is True then add some nodes and a partition for them. {% if slurm_with_gpu %} NodeName={{ slurm_gpu_nodes }} RealMemory=250000 Sockets=2 CoresPerSocket=12 ThreadsPerCore=2 State=UNKNOWN feature=gpu -PartitionName=normal Nodes={{ slurm_compute_nodes }},{{ slurm_gpu_nodes }} Default=YES MaxTime=INFINITE State=UP DefaultTime=2:00:00 -{% else %} -PartitionName=normal Nodes={{ slurm_compute_nodes }} Default=YES MaxTime=INFINITE State=UP DefaultTime=2:00:00 {% endif %} -{% if slurm_nodelist is defined %} -{% for nodelist in slurm_nodelist %} -{{ nodelist }} -{% endfor %} {% endif %} -# partitions - -PartitionName=test Nodes={{ slurm_compute_nodes }} Default=NO MaxTime=INFINITE State=UP DefaultTime=2:00:00 -PartitionName=grid Nodes={{ slurm_compute_nodes }} Default=NO MaxTime=INFINITE State=UP DefaultTime=2:00:00 +# partitions {% if slurm_partitionlist is defined %} {% for partition in slurm_partitionlist %} {{ partition }} {% endfor %} +{% else %} +{% if slurm_with_gpu %} +PartitionName=normal Nodes={{ slurm_compute_nodes }},{{ slurm_gpu_nodes }} Default=YES MaxTime=INFINITE State=UP DefaultTime=2:00:00 +{% else %} +PartitionName=normal Nodes={{ slurm_compute_nodes }} Default=YES MaxTime=INFINITE State=UP DefaultTime=2:00:00 +{% endif %} +PartitionName=test Nodes={{ slurm_compute_nodes }} Default=NO MaxTime=INFINITE State=UP DefaultTime=2:00:00 +PartitionName=grid Nodes={{ slurm_compute_nodes }} Default=NO MaxTime=INFINITE State=UP DefaultTime=2:00:00 {% endif %}