Skip to content

Commit cfc79dd

Browse files
committed
fix(conf): gpu detection on old versions of jinja2
Unfortunately, map('bool') on old versions of jinja2 does not work as expected on a list of integers, it returns a list of False whatever the value of the integer. As an alternative, sum all integers and check result is above zeo.
1 parent ae3d38e commit cfc79dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

conf/group_vars/all.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ slurm_profiles:
3737
compute: compute
3838
server: admin
3939
login: login
40+
slurm_compute_nodes: "{{ fhpc_nodes['compute'] }}"
4041
# GRES GPU enabled if at least one type of compute nodes has gpu
41-
slurm_with_gres_gpu: "{{ fhpc_nodes['compute'] | map(attribute='gpus') | map('length') | map('bool') | max }}"
42+
slurm_with_gres_gpu: "{{ slurm_compute_nodes | map(attribute='gpus') | map('length') | sum > 0 }}"
4243
slurm_local_munge_key_file: "{{ fhpc_cluster_state_dir }}/munge/munge.key"
4344
slurm_local_slurm_key_file: "{{ fhpc_cluster_state_dir }}/slurm/slurm.key"
4445
slurm_local_mariadb_password_file: "{{ fhpc_cluster_state_dir }}/mariadb/mariadb.password"
@@ -49,7 +50,6 @@ slurm_restd_with_unix_socket: "{{ fhpc_slurmrestd_with_unix_socket }}"
4950
slurm_restd_socket: "{{ fhpc_slurmrestd_socket }}"
5051
slurm_restd_port: "{{ fhpc_slurmrestd_port }}"
5152
slurm_accounts: "{{ fhpc_groups }}"
52-
slurm_compute_nodes: "{{ fhpc_nodes['compute'] }}"
5353
racksdb_database: "{{ fhpc_db }}"
5454
redis_local_password_file: "{{ fhpc_cluster_state_dir }}/redis/redis.password"
5555
slurmweb_local_slurmrestd_jwt_key_file: "{{ fhpc_local_slurm_jwt_key }}"

0 commit comments

Comments
 (0)