From 309862e70f61e575c2cfc2900a0d126ca20e8a20 Mon Sep 17 00:00:00 2001
From: Damian Alvarez <swmanage@juwels02.ib.juwels.fzj.de>
Date: Fri, 28 Aug 2020 19:05:20 +0200
Subject: [PATCH] Added npsmpic toolchain

---
 Custom_Toolchains/npsmpic.py          | 41 +++++++++++++++++++++++++++
 Custom_Toolchains/nvhpc.py            |  4 +--
 Golden_Repo/README.md                 |  7 ++++-
 Golden_Repo/n/npsmpic/npsmpic-2020.eb | 21 ++++++++++++++
 4 files changed, 70 insertions(+), 3 deletions(-)
 create mode 100644 Custom_Toolchains/npsmpic.py
 create mode 100644 Golden_Repo/n/npsmpic/npsmpic-2020.eb

diff --git a/Custom_Toolchains/npsmpic.py b/Custom_Toolchains/npsmpic.py
new file mode 100644
index 000000000..33ee2bb06
--- /dev/null
+++ b/Custom_Toolchains/npsmpic.py
@@ -0,0 +1,41 @@
+##
+# Copyright 2016-2016 Ghent University
+# Copyright 2016-2016 Forschungszentrum Juelich
+#
+# This file is part of EasyBuild,
+# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
+# with support of Ghent University (http://ugent.be/hpc),
+# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
+# Flemish Research Foundation (FWO) (http://www.fwo.be/en)
+# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
+#
+# http://github.com/hpcugent/easybuild
+#
+# EasyBuild is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation v2.
+#
+# EasyBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.
+##
+"""
+EasyBuild support for npsmpi compiler toolchain (includes NVHPC and ParaStationMPI, and CUDA as dependency).
+
+@author: Damian Alvarez (Forschungszentrum Juelich)
+"""
+
+from easybuild.toolchains.nvhpc import NvhpcToolchain
+# We pull in MPI and CUDA at once so this maps nicely to HMNS
+from easybuild.toolchains.mpi.psmpi import Psmpi
+from easybuild.toolchains.compiler.cuda import Cuda
+
+# Order matters!
+class Npsmpic(NvhpcToolchain, Cuda, Psmpi):
+    """Compiler toolchain with NVHPC and ParaStationMPI, with CUDA as dependency."""
+    NAME = 'npsmpic'
+    SUBTOOLCHAIN = NvhpcToolchain.NAME
diff --git a/Custom_Toolchains/nvhpc.py b/Custom_Toolchains/nvhpc.py
index cc6c8e2a2..abff3ec91 100644
--- a/Custom_Toolchains/nvhpc.py
+++ b/Custom_Toolchains/nvhpc.py
@@ -26,9 +26,9 @@
 # along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.
 ##
 """
-EasyBuild support for PGI compiler toolchain.
+EasyBuild support for NVHPC compiler toolchain.
 
-:author: Bart Oldeman (McGill University, Calcul Quebec, Compute Canada)
+@author: Andreas Herten (Forschungszentrum Juelich)
 """
 
 from easybuild.toolchains.compiler.nvhpc import Nvhpc
diff --git a/Golden_Repo/README.md b/Golden_Repo/README.md
index 0b0c3be87..ca910afea 100644
--- a/Golden_Repo/README.md
+++ b/Golden_Repo/README.md
@@ -11,15 +11,20 @@ The table below shows the details of the toolchains in the 2020 stage:
 | Toolchain name |     Toolchain version     | Underlying GCC |     Compiler     |          MPI           |   CUDA   | Math libraries |  Includes software from   |
 |----------------|---------------------------|----------------|------------------|------------------------|----------|----------------|---------------------------|
 | GCC            | 9.3.0                     | 9.3.0          | GCC 9.3.0        |                        |          |                | GCCcore                   |
+| NVHPC          | 20.7-GCC-9.3.0            | 9.3.0          | NVHPC 20.7       |                        |          |                | GCCcore                   |
 
 - Compilers+MPI
 
 | Toolchain name |     Toolchain version     | Underlying GCC |     Compiler     |          MPI           |   CUDA   | Math libraries |  Includes software from   |
 |----------------|---------------------------|----------------|------------------|------------------------|----------|----------------|---------------------------|
-| gpsmpi         | 2020                      | 9.3.0          | GCC 9.3.0        | ParaStationMPI 5.4.X   |  11.0.X  |                | GCCcore, GCC              |
+| gpsmpi         | 2020                      | 9.3.0          | GCC 9.3.0        | ParaStationMPI 5.4.X   |  11.0.X§ |                | GCCcore, GCC              |
+| npsmpic        | 2020                      | 9.3.0          | NVHPC 20.7       | ParaStationMPI 5.4.X   |  11.0.X  |                | GCCcore, GCC              |
 
 - Compilers+MPI+Math
 
 | Toolchain name |     Toolchain version     | Underlying GCC |     Compiler     |          MPI           |   CUDA   | Math libraries |  Includes software from   |
 |----------------|---------------------------|----------------|------------------|------------------------|----------|----------------|---------------------------|
 | gpsmkl         | 2020                      | 9.3.0          | GCC 9.3.0        | ParaStationMPI 5.4.X   |          | MKL 2020.1.217 | GCCcore, GCC, gpsmpi      |
+
+
+§ Not included in the toolchain just as dependency
diff --git a/Golden_Repo/n/npsmpic/npsmpic-2020.eb b/Golden_Repo/n/npsmpic/npsmpic-2020.eb
new file mode 100644
index 000000000..d233ab6a4
--- /dev/null
+++ b/Golden_Repo/n/npsmpic/npsmpic-2020.eb
@@ -0,0 +1,21 @@
+easyblock = 'Toolchain'
+
+name = 'npsmpic'
+version = '2020'
+
+homepage = '(none)'
+description = 'NVHPC based compiler toolchain, including Parastation MPICH2 for MPI support.'
+
+site_contacts = 'sc@fz-juelich.de'
+
+toolchain = SYSTEM
+
+local_compiler = ('NVHPC', '20.7-GCC-9.3.0')
+
+dependencies = [
+    local_compiler,
+    ('CUDA', '11.0', '', SYSTEM),
+    ('psmpi', '5.4.7-1', '', local_compiler),
+]
+
+moduleclass = 'toolchain'
-- 
GitLab