cmake and ctest corrections for mpi and srun
authorCezary Czaplewski <czarek@chem.univ.gda.pl>
Thu, 26 May 2016 08:44:16 +0000 (10:44 +0200)
committerCezary Czaplewski <czarek@chem.univ.gda.pl>
Thu, 26 May 2016 08:44:16 +0000 (10:44 +0200)
CMakeLists.txt
source/xdrfpdb/src/CMakeLists.txt

index 3022b58..2ee17e3 100644 (file)
@@ -144,7 +144,12 @@ find_package(MPI QUIET)
 if (MPI_Fortran_FOUND)
   message("MPI found")
   FIX_DBL_INCLUDE(MPI_Fortran_INCLUDE_PATH)
+  message(MPI_Fortran_INCLUDE_PATH)
+  message(${MPI_Fortran_INCLUDE_PATH})
+  message(MPI_Fortran_LIBRARIES)
+  message(${MPI_Fortran_LIBRARIES})
   option(UNRES_SRUN "Use srun instead of mpiexec ?" OFF )
+  option(UNRES_MPIRUN "Use mpirun instead of mpiexec ?" OFF )
 else()
   message("MPI not found - disabling MPI compile flags ")
   set ( UNRES_WITH_MPI "OFF")
index dabac2e..e7b6907 100644 (file)
@@ -103,6 +103,13 @@ install(TARGETS xdrf2ang   DESTINATION ${CMAKE_INSTALL_PREFIX}/xdrfpdb)
 # TESTS
 #=========================================
 
+  if (UNRES_SRUN)
+   set (SRUN "srun")
+  else()
+   set (SRUN "")
+  endif()
+
+
 
 # Create files needed for tests
 
@@ -126,16 +133,16 @@ file(     COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_MREMD_MD000.cx
 
 
 # Test xdrf2pdb 
-add_test(NAME XDRF2PDB-one   COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb one ala10one.seq ala10MD.cx )
-add_test(NAME XDRF2PDB-three COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb three ala10three.seq ala10MD.cx )
+add_test(NAME XDRF2PDB-one   COMMAND ${SRUN} ${CMAKE_BINARY_DIR}/bin/xdrf2pdb one ala10one.seq ala10MD.cx )
+add_test(NAME XDRF2PDB-three COMMAND ${SRUN} ${CMAKE_BINARY_DIR}/bin/xdrf2pdb three ala10three.seq ala10MD.cx )
 
 # Test xdrf2pdb-m
-add_test(NAME XDRF2PDB-M-one   COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb-m one 1L2Yone.seq 1L2Y_MREMD_MD000.cx 32 30 )
-add_test(NAME XDRF2PDB-M-three COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb-m three 1L2Ythree.seq 1L2Y_MREMD_MD000.cx 32 30 )
+add_test(NAME XDRF2PDB-M-one   COMMAND ${SRUN} ${CMAKE_BINARY_DIR}/bin/xdrf2pdb-m one 1L2Yone.seq 1L2Y_MREMD_MD000.cx 32 30 )
+add_test(NAME XDRF2PDB-M-three COMMAND ${SRUN} ${CMAKE_BINARY_DIR}/bin/xdrf2pdb-m three 1L2Ythree.seq 1L2Y_MREMD_MD000.cx 32 30 )
 
 # Test xdrf2ang
-add_test(NAME XDRF2ANG-one   COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2ang one ala10one.seq ala10MD.cx )
-add_test(NAME XDRF2ANG-three COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2ang three ala10three.seq ala10MD.cx )
+add_test(NAME XDRF2ANG-one   COMMAND ${SRUN} ${CMAKE_BINARY_DIR}/bin/xdrf2ang one ala10one.seq ala10MD.cx )
+add_test(NAME XDRF2ANG-three COMMAND ${SRUN} ${CMAKE_BINARY_DIR}/bin/xdrf2ang three ala10three.seq ala10MD.cx )