From 69b527beb6b80bd58796cc0475b04636d65941ea Mon Sep 17 00:00:00 2001
From: Debolskiy Andrey <and.debol@gmail.com>
Date: Sat, 11 Nov 2023 22:38:24 +0300
Subject: [PATCH] updated vars for run script generation

---
 cluster_configs/ifa-cluster.cmake      | 51 ++++++++++++++++++++++++++
 cluster_configs/inm-cluster-avx.cmake  |  3 +-
 cluster_configs/inm-cluster-avx2.cmake |  3 +-
 3 files changed, 55 insertions(+), 2 deletions(-)
 create mode 100644 cluster_configs/ifa-cluster.cmake

diff --git a/cluster_configs/ifa-cluster.cmake b/cluster_configs/ifa-cluster.cmake
new file mode 100644
index 0000000..07ac507
--- /dev/null
+++ b/cluster_configs/ifa-cluster.cmake
@@ -0,0 +1,51 @@
+#get from loaded modules versions of compilers
+
+
+#NETCDF support
+if (USE_NETCDF)
+   set(CUSTOM_NETCDF false FORCE)
+   find_package(Net_CDFCxx)
+endif()
+
+
+if ( compiler_lc STREQUAL "intel")
+    if (NO_MPI)
+        set(CMAKE_C_COMPILER       icc      CACHE STRING "C compiler"       FORCE) # C compiler for serial build
+        set(CMAKE_CXX_COMPILER     c++      CACHE STRING "CXX compiler"     FORCE) # C++ compiler for serial build
+        set(CMAKE_Fortran_COMPILER ifort    CACHE STRING "Fortran compiler" FORCE) # Fortran compiler for serial build
+    else()
+        set(CMAKE_C_COMPILER       mpiicpc  CACHE STRING "C compiler"       FORCE) # C compiler for parallel build
+        set(CMAKE_CXX_COMPILER     mpiicpc CACHE STRING "CXX compiler"     FORCE) # C++ compiler for parallel build
+        set(CMAKE_Fortran_COMPILER mpiifort CACHE STRING "Fortran compiler" FORCE) # Fortran compiler for parallel build
+    endif()
+    set(comp_flags " -restrict -alias-const -parallel -funroll-loops -no-ansi-alias -mavx -fma  ")
+endif()
+
+if ( compiler_lc STREQUAL "intel_oneapi")
+    messege(ERROR "ONEAPI is not supported on IFA cluster")
+endif()
+
+if ( compiler_lc STREQUAL "gnu")
+    if (NO_MPI)
+        set(CMAKE_C_COMPILER       gcc      CACHE STRING "C compiler"       FORCE) # C compiler for serial build
+        set(CMAKE_CXX_COMPILER     g++      CACHE STRING "CXX compiler"     FORCE) # C++ compiler for serial build
+        set(CMAKE_Fortran_COMPILER gfortran    CACHE STRING "Fortran compiler" FORCE) # Fortran compiler for serial build
+    else()
+        set(CMAKE_C_COMPILER       mpicc  CACHE STRING "C compiler"       FORCE) # C compiler for parallel build
+        set(CMAKE_CXX_COMPILER     mpicxx CACHE STRING "CXX compiler"     FORCE) # C++ compiler for parallel build
+        set(CMAKE_Fortran_COMPILER mpifort CACHE STRING "Fortran compiler" FORCE) # Fortran compiler for parallel build
+    endif()
+    set(comp_flags "  -O3 -fno-strict-aliasing -funroll-loops -march=native    -std=c++0x ")
+endif()
+
+#specify stuff for run-script
+set(cluster_queue "epyc")
+if ( ${compiler_lc} STREQUAL "intel" OR ${compiler_lc} STREQUAL "intel_oneapi")
+    set(run_exec "srun -u")
+    set(prerun_env_export "module load mpi/impi && export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so")
+endif()
+
+
+if ( compiler_lc STREQUAL "gnu")
+    set(run_exec "mpirun")
+endif ()
\ No newline at end of file
diff --git a/cluster_configs/inm-cluster-avx.cmake b/cluster_configs/inm-cluster-avx.cmake
index c2e7942..af55c7d 100644
--- a/cluster_configs/inm-cluster-avx.cmake
+++ b/cluster_configs/inm-cluster-avx.cmake
@@ -56,4 +56,5 @@ if ( compiler_lc STREQUAL "gnu")
 endif()
 
 #specify stuff for run-script
-set(cluster_queue "normal")
\ No newline at end of file
+set(cluster_queue "normal")
+set(run_exec "mpirun")
\ No newline at end of file
diff --git a/cluster_configs/inm-cluster-avx2.cmake b/cluster_configs/inm-cluster-avx2.cmake
index 19c7c76..3fc9072 100644
--- a/cluster_configs/inm-cluster-avx2.cmake
+++ b/cluster_configs/inm-cluster-avx2.cmake
@@ -56,4 +56,5 @@ set(comp_flags " -O3 -fno-strict-aliasing -funroll-loops -mavx2  -std=c++0x ")
 endif()
 
 #specify stuff for run-script
-set(cluster_queue "normal")
\ No newline at end of file
+set(cluster_queue "normal")
+set(run_exec "mpirun")
\ No newline at end of file
-- 
GitLab