From 4a14d921d266ade3730951468c6e83371cd97bc4 Mon Sep 17 00:00:00 2001
From: Nicolas Richart <nicolas.richart@epfl.ch>
Date: Tue, 23 Jan 2024 00:28:09 +0100
Subject: [PATCH] when synthax does not work the same in packages and in
 spack.yaml

---
 packages.yaml | 14 --------------
 spack.yaml    | 28 ++++++++++++++++++----------
 2 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/packages.yaml b/packages.yaml
index 15e62d3..b79c476 100644
--- a/packages.yaml
+++ b/packages.yaml
@@ -23,20 +23,6 @@ packages:
   # ----------------------------------------------------------------------------
   # Requirements
   # ----------------------------------------------------------------------------
-  ucx:
-    require:
-      - spec: "+rdmacm +rc +dc +ud +cma +mlx5_dv +parameter_checking +thread_multiple +verbs"
-      - spec: "+cuda cuda_arch=70 +gdrcopy"
-        when: 'env.get("environment", "") == "izar"'
-
-  openmpi:
-    require:
-      - spec: "fabrics=ofi,ucx,verbs schedulers=slurm ~rsh"
-      - spec: "+gpfs"
-        when: "env['environment'] == 'helvetios'"
-      - spec: "+cuda cuda_arch=70"
-        when: "env['environment'] == 'izar'"
-
   libfabric:
     require:
       - spec: "fabrics=mlx,tcp,udp,verbs,sockets,psm3,shm"
diff --git a/spack.yaml b/spack.yaml
index 64417b6..c609429 100644
--- a/spack.yaml
+++ b/spack.yaml
@@ -9,17 +9,25 @@ spack:
         - gcc
     - mpi_codes:
         - osu-micro-benchmarks
-    - mpis:
-        - openmpi
+
+    - when: env['environment'] == 'helvetios'
+      mpis:
+        - openmpi fabrics=ofi,ucx,verbs schedulers=slurm ~rsh +gpfs
+          ^ucx +rdmacm +rc +dc +ud +cma +mlx5_dv +parameter_checking +thread_multiple +verbs
+    - when: env['environment'] == 'izar'
+      mpis:
+        - openmpi fabrics=ofi,ucx,verbs schedulers=slurm ~rsh +gpfs +cuda cuda_arch=70
+          ^ucx +rdmacm +rc +dc +ud +cma +mlx5_dv +parameter_checking +thread_multiple +verbs +cuda cuda_arch=70 +gdrcopy
+
   specs:
-    - $compilers
-    - matrix:
-        - [$mpis]
-        - [$%compilers]
-    - matrix:
-        - [$mpi_codes]
-        - [$^mpis]
-        - [$%compilers]
+  - $compilers
+  - matrix:
+    - [$mpis]
+    - [$%compilers]
+  - matrix:
+    - [$mpi_codes]
+    - [$^mpis]
+    - [$%compilers]
 
   view:
     default:
-- 
GitLab