ctest on cray with srun all tests
[unres.git] / source / unres / src_CSA / CMakeLists.txt
index 53337fe..ae33e99 100644 (file)
@@ -394,14 +394,24 @@ endif(UNRES_CSA_FF STREQUAL "E0LL2Y")
      set (boot_lam "")
   endif()
 
+
+  if (UNRES_SRUN)
+   set (np "-n")
+   set (mpiexec "srun")
+  else()
+   set (np "-np")
+   set (mpiexec "mpiexec")
+  endif()
+
+
 if(UNRES_CSA_FF STREQUAL "4P")
-    add_test(NAME UNRES_CSA_global COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_4P )
-    add_test(NAME UNRES_CSA_local COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_local_4P )
+    add_test(NAME UNRES_CSA_global COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_4P )
+    add_test(NAME UNRES_CSA_local COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_4P.sh 1l2y_csa_local_4P )
 endif(UNRES_CSA_FF STREQUAL "4P")
 
 if(UNRES_CSA_FF STREQUAL "E0LL2Y")
-    add_test(NAME UNRES_CSA_global_E0LL2Y COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa )
-    add_test(NAME UNRES_CSA_local_E0LL2Y COMMAND mpiexec ${boot_lam} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa_local )
+    add_test(NAME UNRES_CSA_global_E0LL2Y COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa )
+    add_test(NAME UNRES_CSA_local_E0LL2Y COMMAND ${mpiexec} ${boot_lam} ${np} 4 ${CMAKE_CURRENT_BINARY_DIR}/test_csa_E0LL2Y.sh 1l2y_csa_local )
 endif(UNRES_CSA_FF STREQUAL "E0LL2Y")