ctest checkgrad
[unres4.git] / source / unres / CMakeLists.txt
index 7c7359c..443deb6 100644 (file)
@@ -29,10 +29,10 @@ set(UNRES_MD_SRC0
         io_base.f90
         energy.f90
         check_bond.f90
-        control.f90
+        control.F90
         MPI.f90
         regularize.f90
-        compare.f90
+        compare.F90
         map.f90
         muca_md.f90
         MCM_MD.f90
@@ -203,9 +203,9 @@ set_property(SOURCE ${UNRES_MD_SRCS} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
 #=========================================
 # Build the binary
 #=========================================
-add_executable(UNRES_BIN-MD ${UNRES_MD_SRCS} )
-set_target_properties(UNRES_BIN-MD PROPERTIES OUTPUT_NAME ${UNRES_BIN})
-set_property(TARGET UNRES_BIN-MD PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
+add_executable(UNRES_BIN ${UNRES_MD_SRCS} )
+set_target_properties(UNRES_BIN PROPERTIES OUTPUT_NAME ${UNRES_BIN})
+set_property(TARGET UNRES_BIN PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
 
 
 #=========================================
@@ -214,16 +214,16 @@ set_property(TARGET UNRES_BIN-MD PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINAR
 # link MPI library (libmpich.a)  
 
 if(UNRES_WITH_MPI)
-  target_link_libraries( UNRES_BIN-MD ${MPI_Fortran_LIBRARIES} )
+  target_link_libraries( UNRES_BIN ${MPI_Fortran_LIBRARIES} )
 endif(UNRES_WITH_MPI)
 # link libxdrf.a 
 #message("UNRES_XDRFLIB=${UNRES_XDRFLIB}")
-target_link_libraries( UNRES_BIN-MD xdrf )
+target_link_libraries( UNRES_BIN xdrf )
 
 #=========================================
 # Install Path
 #=========================================
-install(TARGETS UNRES_BIN-MD DESTINATION ${CMAKE_INSTALL_PREFIX}) 
+install(TARGETS UNRES_BIN DESTINATION ${CMAKE_INSTALL_PREFIX}) 
 
 #=========================================
 # TESTS 
@@ -371,6 +371,11 @@ FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/matplotlib_hist.py
         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
 )
 
+FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/checkgrad.awk
+        DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
+
+FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_CHECKGRAD.inp
+        DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
 
 
 #=========================================
@@ -386,18 +391,18 @@ export PREFIX=$1
 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
 #-----------------------------------------------------------------------------
 DD=${CMAKE_SOURCE_DIR}/PARAM
-export BONDPAR=$DD/bond_AM1.parm
-export THETPAR=$DD/theta_abinitio.parm
-export ROTPAR=$DD/rotamers_AM1_aura.10022007.parm
-export TORPAR=$DD/torsion_631Gdp.parm
-export TORDPAR=$DD/torsion_double_631Gdp.parm
-export ELEPAR=$DD/electr_631Gdp.parm
-export SIDEPAR=$DD/scinter_$POT.parm
-export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
-export SCPPAR=$DD/scp.parm
-export SCCORPAR=$DD/sccor_am1_pawel.dat
-export THETPARPDB=$DD/thetaml.5parm
-export ROTPARPDB=$DD/scgauss.parm
+export BONDPAR=$DD/bond_AM1_ext.parm
+export THETPAR=$DD/theta_abinitio_old_ext.parm
+export THETPARPDB=$DD/thetaml_ext.5parm
+export ROTPARPDB=$DD/scgauss_ext.parm
+export ROTPAR=$DD/rotamers_AM1_aura_ext.10022007.parm
+export TORPAR=$DD/torsion_631Gdp_old_ext.parm
+export TORDPAR=$DD/torsion_double_631Gdp_old_ext.parm
+export ELEPAR=$DD/electr_631Gdp_ext.parm
+export SIDEPAR=$DD/scinter_GB_ext.parm
+export FOURIER=$DD/fourier_opt_ext.parm.1igd_hc_iter3_3
+export SCCORPAR=$DD/sccor_am1_pawel_ext.dat
+export SCPPAR=$DD/scp_ext.parm
 export PATTERN=$DD/patterns.cart
 #-----------------------------------------------------------------------------
 echo CTEST_FULL_OUTPUT
@@ -442,18 +447,18 @@ export PREFIX=$1
 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
 #-----------------------------------------------------------------------------
 DD=${CMAKE_SOURCE_DIR}/PARAM
-export BONDPAR=$DD/bond_AM1.parm
-export THETPAR=$DD/theta_abinitio.parm
-export ROTPAR=$DD/rotamers_AM1_aura.10022007.parm
-export TORPAR=$DD/torsion_631Gdp.parm
-export TORDPAR=$DD/torsion_double_631Gdp.parm
-export ELEPAR=$DD/electr_631Gdp.parm
-export SIDEPAR=$DD/scinter_$POT.parm
-export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
-export SCPPAR=$DD/scp.parm
-export SCCORPAR=$DD/sccor_am1_pawel.dat
-export THETPARPDB=$DD/thetaml.5parm
-export ROTPARPDB=$DD/scgauss.parm
+export BONDPAR=$DD/bond_AM1_ext.parm
+export THETPAR=$DD/theta_abinitio_old_ext.parm
+export THETPARPDB=$DD/thetaml_ext.5parm
+export ROTPARPDB=$DD/scgauss_ext.parm
+export ROTPAR=$DD/rotamers_AM1_aura_ext.10022007.parm
+export TORPAR=$DD/torsion_631Gdp_old_ext.parm
+export TORDPAR=$DD/torsion_double_631Gdp_old_ext.parm
+export ELEPAR=$DD/electr_631Gdp_ext.parm
+export SIDEPAR=$DD/scinter_GB_ext.parm
+export FOURIER=$DD/fourier_opt_ext.parm.1igd_hc_iter3_3
+export SCCORPAR=$DD/sccor_am1_pawel_ext.dat
+export SCPPAR=$DD/scp_ext.parm
 export PATTERN=$DD/patterns.cart
 #-----------------------------------------------------------------------------
 echo CTEST_FULL_OUTPUT
@@ -504,6 +509,8 @@ else(NOT UNRES_WITH_MPI)
   if(UNRES_MD_FF STREQUAL "E0LL2Y")
     add_test(NAME UNRES_ENE_prota COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE 2 )
     add_test(NAME UNRES_ENE1_prota COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE 1 )
+    add_test(NAME UNRES_CHECKGRAD_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh prota_CHECKGRAD 2 2 )
+    add_test(NAME UNRES_CHECKGRAD1_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh prota_CHECKGRAD 1 1 )
     add_test(NAME UNRES_MIN_prota COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_MIN_CART 2 )
     add_test(NAME UNRES_MIN_INT COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_INT 1 )
     add_test(NAME UNRES_REGULAR COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_REGULAR_INT 1 )