6aa6fc6f97f5b08b598061486bd011b5ac459c74
[unres.git] / source / unres / src_MD-M / CMakeLists.txt
1 #
2 # CMake project file for UNRES with MD for single chains
3
4
5 enable_language (Fortran)
6
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_MDM_SRC0 
11         add.f 
12         arcos.f
13         banach.f
14         bank.F 
15         blas.f 
16         bond_move.f 
17         cartder.F 
18         cartprint.f 
19         chainbuild.F 
20         check_bond.f 
21         checkder_p.F 
22         check_sc_distr.f
23         compare_s1.F 
24         contact.f 
25         convert.f 
26         cored.f
27         csa.f 
28         dihed_cons.F
29         diff12.f
30         distfit.f 
31         djacob.f
32         econstr_local.F
33         eigen.f 
34         elecont.f 
35         energy_split-sep.F 
36         entmcm.F
37         fitsq.f 
38         gauss.f 
39         gen_rand_conf.F
40         geomout.F 
41         gnmr1.f
42         indexx.f 
43         initialize_p.F 
44         intcartderiv.F
45         intcor.f 
46         intlocal.f 
47         int_to_cart.f 
48         kinetic_lesyng.f 
49         lagrangian_lesyng.F
50         local_move.f 
51         map.f 
52         matmult.f 
53         mc.F 
54         mcm.F 
55         MD_A-MTS.F 
56         minimize_p.F
57         minim_jlee.F 
58         minim_mcmf.F 
59         misc.f 
60         moments.f
61         MP.F 
62         MREMD.F 
63         muca_md.f 
64         newconf.f
65         parmread.F 
66         permut.F
67         pinorm.f 
68         printmat.f 
69         prng_32.F
70         q_measure.F 
71         ran.f
72         randgens.f 
73         rattle.F 
74         readpdb.F
75         readrtns_CSA.F 
76         refsys.f 
77         regularize.F
78         rescode.f 
79         rmdd.f 
80         rmsd.F 
81         sc_move.F 
82         shift.F
83         sort.f 
84         stochfric.F 
85         sumsld.f 
86         surfatom.f 
87         test.F 
88         thread.F 
89         timing.F
90         together.F
91         unres.F
92         ssMD.F
93 )
94
95 set(UNRES_MDM_SRC3 energy_p_new_barrier.F energy_p_new-sep_barrier.F gradient_p.F )
96
97 set(UNRES_MDM_PP_SRC
98         bank.F 
99         cartder.F 
100         chainbuild.F 
101         checkder_p.F 
102         compare_s1.F
103         cored.f
104         csa.f 
105         dihed_cons.F
106         diff12.f 
107         econstr_local.F 
108         energy_p_new.F
109         energy_p_new_barrier.F 
110         energy_p_new-sep_barrier.F 
111         energy_split-sep.F 
112         entmcm.F 
113         gen_rand_conf.F
114         geomout.F 
115         gradient_p.F 
116         intcor.f
117         initialize_p.F 
118         intcartderiv.F 
119         lagrangian_lesyng.F 
120         matmult.f
121         mc.F 
122         mcm.F 
123         MD_A-MTS.F
124         minimize_p.F 
125         minim_jlee.F
126         minim_mcmf.F 
127         MP.F 
128         MREMD.F
129         newconf.f 
130         parmread.F 
131         permut.F
132         prng_32.F
133         q_measure1.F 
134         q_measure3.F 
135         q_measure.F
136         ran.f
137         rattle.F 
138         readpdb.F 
139         readrtns_CSA.F 
140         regularize.F
141         rmdd.f 
142         rmsd.F 
143         sc_move.F
144         shift.F 
145         stochfric.F
146         sumsld.f 
147         test.F 
148         thread.F 
149         timing.F
150         together.F
151         unres.F
152         proc_proc.c
153
154
155
156 if(NOT Fortran_COMPILER_NAME STREQUAL "ifort")
157   set(UNRES_MDM_PP_SRC "${UNRES_MDM_PP_SRC} prng_32.F") 
158 endif(NOT Fortran_COMPILER_NAME STREQUAL "ifort")
159
160
161 #================================================
162 # Set comipiler flags for different sourcefiles  
163 #================================================
164 if (Fortran_COMPILER_NAME STREQUAL "ifort")
165   set(FFLAGS0 "-ip -w -mcmodel=medium -shared-intel " ) 
166   set(FFLAGS1 "-w -g -d2 -CA -CB -mcmodel=medium -shared-intel " ) 
167   set(FFLAGS2 "-w -g -00 -mcmodel=medium -shared-intel ")
168   set(FFLAGS3 "-w -ipo -mcmodel=medium -shared-intel " )
169 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
170   set(FFLAGS0 "-std=legacy -I. -mcmodel=medium " ) 
171   set(FFLAGS1 "-std=legacy -g -I. -mcmodel=medium " ) 
172   set(FFLAGS2 "-std=legacy -I. -mcmodel=medium ")
173   set(FFLAGS3 "-std=legacy -I. -mcmodel=medium " )
174 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
175
176
177 # Add MPI compiler flags
178 if(UNRES_WITH_MPI)
179   set(FFLAGS0 "${FFLAGS0} -I${MPI_Fortran_INCLUDE_PATH}")
180   set(FFLAGS1 "${FFLAGS1} -I${MPI_Fortran_INCLUDE_PATH}")
181   set(FFLAGS2 "${FFLAGS2} -I${MPI_Fortran_INCLUDE_PATH}")
182   set(FFLAGS3 "${FFLAGS3} -I${MPI_Fortran_INCLUDE_PATH}")
183 endif(UNRES_WITH_MPI)
184
185 set_property(SOURCE ${UNRES_MDM_SRC0} APPEND PROPERTY COMPILE_FLAGS ${FFLAGS0} )
186 #set_property(SOURCE ${UNRES_MD_SRC1} PROPERTY COMPILE_FLAGS ${FFLAGS1} )
187 #set_property(SOURCE ${UNRES_MD_SRC2} PROPERTY COMPILE_FLAGS ${FFLAGS2} )
188 set_property(SOURCE ${UNRES_MDM_SRC3} PROPERTY COMPILE_FLAGS ${FFLAGS3} )
189
190 #=========================================
191 # Settings for GAB force field 
192 #=========================================
193 if(UNRES_MD_FF STREQUAL "GAB" )
194   # set preprocesor flags   
195   set(CPPFLAGS "PROCOR -DUNRES -DISNAN -DSPLITELE -DLANG0 -DCRYST_BOND -DCRYST_THETA -DCRYST_SC" )
196
197 #=========================================
198 #  Settings for E0LL2Y force field
199 #=========================================
200 elseif(UNRES_MD_FF STREQUAL "E0LL2Y")
201   # set preprocesor flags   
202   set(CPPFLAGS "PROCOR -DUNRES -DISNAN -DSPLITELE -DLANG0" )
203 elseif(UNRES_MD_FF STREQUAL "4P")
204   set(CPPFLAGS "UNRES -DISNAN -DSPLITELE -DLANG0 -DCRYST_BOND -DCRYST_THETA -DCRYST_SC -DSCCORPDB" )
205 endif(UNRES_MD_FF STREQUAL "GAB")
206
207
208 #=========================================
209 # System specific flags
210 #=========================================
211 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
212   set(CPPFLAGS "${CPPFLAGS} -DLINUX") 
213 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
214
215
216 #=========================================
217 # Compiler specific flags
218 #=========================================
219
220 if (Fortran_COMPILER_NAME STREQUAL "ifort")
221   # Add ifort preprocessor flags
222   set(CPPFLAGS "${CPPFLAGS} -DPGI") 
223 elseif (Fortran_COMPILER_NAME STREQUAL "f95")
224   # Add new gfortran flags
225   set(CPPFLAGS "${CPPFLAGS} -DG77") 
226 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
227   # Add old gfortran flags
228   set(CPPFLAGS "${CPPFLAGS} -DG77") 
229 elseif (Fortran_COMPILER_NAME STREQUAL "pgf90")
230   set(CPPFLAGS "${CPPFLAGS} -DPGI")
231   FILE(COPY ${CMAKE_SOURCE_DIR}/source/lib/isnan_pgi.f DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
232   list(APPEND UNRES_MDM_SRC0 ${CMAKE_CURRENT_BINARY_DIR}/isnan_pgi.f)
233 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
234
235
236 #=========================================
237 # Add MPI preprocessor flags
238 #=========================================
239 if (UNRES_WITH_MPI)
240   set(CPPFLAGS "${CPPFLAGS} -DMP -DMPI") 
241 endif(UNRES_WITH_MPI)
242
243
244 #=========================================
245 # add 64-bit specific preprocessor flags
246 #=========================================
247 if (architektura STREQUAL "64")
248   set(CPPFLAGS "${CPPFLAGS} -DAMD64")
249 endif (architektura STREQUAL "64")
250
251
252
253 # Apply preprocesor flags to *.F files
254 set_property(SOURCE ${UNRES_MDM_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )  
255
256 # Apply preprocesor flags to proc_proc.c
257 set_property(SOURCE proc_proc.c PROPERTY COMPILE_DEFINITIONS "SGI" )  
258
259
260 #========================================
261 #  Setting binary name
262 #========================================
263 if(UNRES_WITH_MPI) 
264   # binary with mpi
265   set(UNRES_BIN "unresMD-mult_${Fortran_COMPILER_NAME}_MPI_${UNRES_MD_FF}.exe")
266 else(UNRES_WITH_MPI)
267   # binary without mpi
268   set(UNRES_BIN "unresMD-mult_${Fortran_COMPILER_NAME}_single_${UNRES_MD_FF}.exe")
269 endif(UNRES_WITH_MPI)  
270
271 #=========================================
272 # cinfo.f workaround for cmake
273 #=========================================
274 # get the current date  
275 TODAY(DATE)
276 # generate cinfo.f
277 set(CINFO "${CMAKE_CURRENT_BINARY_DIR}/cinfo.f")
278 FILE(WRITE ${CINFO}
279 "C CMake generated file
280        subroutine cinfo
281        include 'COMMON.IOUNITS'
282        write(iout,*)'++++ Compile info ++++'
283        write(iout,*)'Version ${UNRES_MAJOR}.${UNRES_MINOR} build ${UNRES_PATCH}'
284 ")
285
286 CINFO_FORMAT(${CINFO} "Compiled" "${DATE}" )
287 CINFO_FORMAT(${CINFO} "Compiled by" "$ENV{USER}@$ENV{HOST}" )
288 CINFO_FORMAT(${CINFO} "OS name:" "${CMAKE_SYSTEM_NAME}" )
289 CINFO_FORMAT(${CINFO} "OS release:" "${CMAKE_SYSTEM}" )
290 CINFO_FORMAT(${CINFO} "Fortran Compiler:" "${CMAKE_Fortran_COMPILER}" )
291 CINFO_FORMAT(${CINFO} "MD Force field:" "${UNRES_MD_FF}" )
292 CINFO_FORMAT(${CINFO} "CPPFLAGS =" "${CPPFLAGS}")
293
294 FILE(APPEND ${CINFO} 
295 "       write(iout,*)'++++ End of compile info ++++'  
296        return 
297        end ")
298
299
300 # add include path
301 set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f PROPERTY COMPILE_FLAGS "${FFLAGS0} -I${CMAKE_CURRENT_SOURCE_DIR}")
302
303 #=========================================
304 # Set full unres MD-M sources
305 #=========================================
306 set(UNRES_MDM_SRCS ${UNRES_MDM_SRC0} ${UNRES_MDM_SRC3} ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f proc_proc.c )
307
308 #=========================================
309 # Build the binary
310 #=========================================
311 add_executable(UNRES_BIN-MD-M ${UNRES_MDM_SRCS} )
312 set_target_properties(UNRES_BIN-MD-M PROPERTIES OUTPUT_NAME ${UNRES_BIN})
313 set_property(TARGET UNRES_BIN-MD-M PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
314 #add_dependencies (${UNRES_BIN} ${UNRES_XDRFLIB})
315
316 #=========================================
317 # Link libraries
318 #=========================================
319 # link MPI library (libmpich.a)  
320 if(UNRES_WITH_MPI)
321   target_link_libraries( UNRES_BIN-MD-M ${MPI_Fortran_LIBRARIES} )
322 endif(UNRES_WITH_MPI)
323 # link libxdrf.a 
324 #message("UNRES_XDRFLIB=${UNRES_XDRFLIB}")
325 target_link_libraries( UNRES_BIN-MD-M xdrf )
326 if (Fortran_COMPILER_NAME STREQUAL "ifort")
327 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mcmodel=medium -shared-intel")
328 else ()
329 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mcmodel=medium ")
330 endif ()
331 #=========================================
332 # Install Path
333 #=========================================
334 install(TARGETS UNRES_BIN-MD-M DESTINATION ${CMAKE_INSTALL_PREFIX}/unres/MD)
335
336 #=========================================
337 # TESTS 
338 #=========================================
339
340 #=========================================
341 # Generate data test files
342 #=========================================
343 #  test_single_ala.sh
344 #=========================================
345
346 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_single_ala.sh
347 "#!/bin/sh
348 export POT=GB
349 export PREFIX=ala10
350 #-----------------------------------------------------------------------------
351 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
352 #-----------------------------------------------------------------------------
353 DD=${CMAKE_SOURCE_DIR}/PARAM
354 export BONDPAR=$DD/bond.parm
355 export THETPAR=$DD/thetaml.5parm
356 export ROTPAR=$DD/scgauss.parm
357 export TORPAR=$DD/torsion_631Gdp.parm
358 export TORDPAR=$DD/torsion_double_631Gdp.parm
359 export ELEPAR=$DD/electr_631Gdp.parm
360 export SIDEPAR=$DD/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
361 export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
362 export SCPPAR=$DD/scp.parm
363 export SCCORPAR=$DD/sccor_pdb_shelly.dat
364 export PATTERN=$DD/patterns.cart
365 #-----------------------------------------------------------------------------
366 $UNRES_BIN
367 ")
368
369 #
370 # File permissions workaround
371 #
372 FILE(   COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_single_ala.sh 
373         DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
374         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
375 )
376
377
378
379 #=========================================
380 #  ala10.inp
381 #=========================================
382
383 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ala10.inp
384 "ala10 unblocked
385 SEED=-1111333 MD ONE_LETTER rescale_mode=2 
386 nstep=15000 ntwe=100 ntwx=1000 dt=0.1 lang=0 tbf t_bath=300 damax=1.0          &
387 reset_moment=1000 reset_vel=1000
388 WLONG=1.35279 WSCP=1.59304 WELEC=0.71534 WBOND=1.00000 WANG=1.13873            &
389 WSCLOC=0.16258 WTOR=1.98599 WTORD=1.57069 WCORRH=0.42887 WCORR5=0.00000        &
390 WCORR6=0.00000 WEL_LOC=0.16036 WTURN3=1.68722 WTURN4=0.66230 WTURN6=0.00000    &
391 WVDWPP=0.11371 WHPB=1.00000                                                    &
392 CUTOFF=7.00000 WCORR4=0.00000
393 12
394 XAAAAAAAAAAX 
395  0
396  0
397    90.0000   90.0000   90.0000  90.000   90.000   90.000   90.000   90.000 
398    90.0000   90.0000
399   180.0000  180.0000  180.0000 180.000  180.000  180.000  180.000  180.000
400   180.0000
401   110.0000  110.0000  110.0000 100.000  110.000  100.000  110.000  110.000 
402   110.0000  110.0000
403  -120.0000 -120.0000 -120.000 -120.000 -120.000 -120.000 -120.000 -120.000
404  -120.0000 -120.0000
405 ")
406
407 if(UNRES_MD_FF STREQUAL "E0LL2Y")
408
409 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota.pdb
410         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
411
412 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_unres.pdb
413         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
414
415 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_ENE_m.inp
416         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
417
418 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_MIN_CART.inp
419         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
420
421 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_micro.inp
422         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
423
424 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_MIN_INT.inp
425         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
426
427 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_MIN_REGULAR_INT.inp
428         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
429
430 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_B.inp
431         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
432
433 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_L.inp
434         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
435
436 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_NH.inp
437         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
438
439
440 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y.pdb
441         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
442
443 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_remd.inp
444         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
445
446 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1ei0_min.inp
447         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
448
449 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1ei0.pdb
450         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
451
452 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1dkz_cut.pdb
453         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
454
455 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1dkz_cut_unres.pdb
456         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
457
458 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-ber.inp
459         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
460
461 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-ene.inp
462         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
463
464 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-lang.inp
465         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
466
467 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-micro.inp
468         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
469
470 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-min.inp
471         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
472
473 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_unres_energy_check_mult.sh
474         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} 
475         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
476 )
477
478 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/matplotlib_fit_hist.py
479         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} 
480         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
481 )
482
483 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/matplotlib_hist.py
484         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} 
485         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
486 )
487
488 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/checkgrad.awk
489         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
490
491 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_CHECKGRAD.inp
492         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
493
494 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-checkgrad.inp
495         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
496
497 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/homology_mult/
498       DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILES_MATCHING PATTERN "*" )
499
500
501 #=========================================
502 #  test_prota_E0LL2Y.sh
503 #=========================================
504
505 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_prota_E0LL2Y.sh
506 "#!/bin/sh
507 export POT=GB
508 export FGPROCS=$2
509 export PREFIX=$1
510 #-----------------------------------------------------------------------------
511 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
512 #-----------------------------------------------------------------------------
513 DD=${CMAKE_SOURCE_DIR}/PARAM
514 export BONDPAR=$DD/bond_AM1_ext_dum.parm
515 export THETPAR=$DD/theta_abinitio_old_ext.parm
516 export THETPARPDB=$DD/thetaml_ext.5parm
517 export ROTPARPDB=$DD/scgauss_ext.parm
518 export ROTPAR=$DD/rotamers_AM1_aura_ext.10022007.parm
519 export TORPAR=$DD/torsion_631Gdp_old_ext.parm
520 export TORDPAR=$DD/torsion_double_631Gdp_old_ext.parm
521 export ELEPAR=$DD/electr_631Gdp_ext.parm
522 export SIDEPAR=$DD//scinter_GB_ext_lip.parm
523 export FOURIER=$DD/fourier_opt_ext.parm.1igd_hc_iter3_3
524 export SCCORPAR=$DD/sccor_am1_pawel_ext.dat
525 export SCPPAR=$DD/scp_ext.parm
526 export PATTERN=$DD/patterns.cart
527 export LIPTRANPAR=$DD/Lip_tran_initial_ext.parm
528 #-----------------------------------------------------------------------------
529 echo CTEST_FULL_OUTPUT
530 $UNRES_BIN
531 ./prota_unres_energy_check_mult.sh $1 ${UNRES_BIN}
532 ")
533
534 #  MESSAGE (STATUS "${MPI_Fortran_LIBRARIES}")
535   if ("${MPI_Fortran_LIBRARIES}"  MATCHES "lam")
536      MESSAGE (STATUS "LAM MPI library detected")
537      set (boot_lam "-boot")
538   else()
539      set (boot_lam "")
540   endif()
541
542   if (UNRES_SRUN)
543    set (np "-n")
544    set (mpiexec "srun")
545   elseif(UNRES_MPIRUN)
546    set (np "-np")
547    set (mpiexec "mpirun")
548   else()
549    set (np "-np")
550    set (mpiexec "mpiexec")
551   endif()
552
553
554 #
555 # File permissions workaround
556 #
557 FILE(   COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_prota_E0LL2Y.sh 
558         DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
559         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
560 )
561
562 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_mpi_E0LL2Y.sh
563 "#!/bin/sh
564 export POT=GB
565 export FGPROCS=$2
566 export PREFIX=$1
567 #-----------------------------------------------------------------------------
568 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
569 #-----------------------------------------------------------------------------
570 DD=${CMAKE_SOURCE_DIR}/PARAM
571 export BONDPAR=$DD/bond_AM1_ext_dum.parm
572 export THETPAR=$DD/theta_abinitio_old_ext.parm
573 export THETPARPDB=$DD/thetaml_ext.5parm
574 export ROTPARPDB=$DD/scgauss_ext.parm
575 export ROTPAR=$DD/rotamers_AM1_aura_ext.10022007.parm
576 export TORPAR=$DD/torsion_631Gdp_old_ext.parm
577 export TORDPAR=$DD/torsion_double_631Gdp_old_ext.parm
578 export ELEPAR=$DD/electr_631Gdp_ext.parm
579 export SIDEPAR=$DD//scinter_GB_ext_lip.parm
580 export FOURIER=$DD/fourier_opt_ext.parm.1igd_hc_iter3_3
581 export SCCORPAR=$DD/sccor_am1_pawel_ext.dat
582 export SCPPAR=$DD/scp_ext.parm
583 export PATTERN=$DD/patterns.cart
584 export LIPTRANPAR=$DD/Lip_tran_initial_ext.parm
585 #-----------------------------------------------------------------------------
586 echo CTEST_FULL_OUTPUT
587 ${mpiexec} ${boot_lam} ${np} $3 $UNRES_BIN | grep -v traj1file |grep -v NaN
588 ./prota_unres_energy_check_mult.sh $1 ${UNRES_BIN}
589 ")
590
591 #
592 # File permissions workaround
593 #
594 FILE(   COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_mpi_E0LL2Y.sh 
595         DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
596         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
597 )
598
599
600 endif(UNRES_MD_FF STREQUAL "E0LL2Y")
601
602
603
604 # Add tests
605
606 if(NOT UNRES_WITH_MPI)
607                   
608   if(UNRES_MD_FF STREQUAL "GAB")
609     add_test(NAME UNRES_M_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
610   endif(UNRES_MD_FF STREQUAL "GAB")
611  
612   if(UNRES_MD_FF STREQUAL "E0LL2Y")
613     add_test(NAME UNRES_M_ENE_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE_m 1 )
614     add_test(NAME UNRES_M_CHECKGRAD_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_CHECKGRAD 1 )
615     add_test(NAME UNRES_M_MIN_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_MIN_CART 1 )
616     add_test(NAME UNRES_M_MIN_INT COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_INT 1 )
617     add_test(NAME UNRES_M_REGULAR COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_REGULAR_INT 1 )
618     add_test(NAME UNRES_M_MD_microcanonical COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_micro 1 )
619     add_test(NAME UNRES_M_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1L2Y_L 1 )
620 #no NH in MD-M
621 #    add_test(NAME UNRES_M_NoseHoover COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1L2Y_NH 1 )
622     add_test(NAME UNRES_M_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1L2Y_B 1 )
623     add_test(NAME UNRES_M_multi_ene COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-ene 1 )
624     add_test(NAME UNRES_M_multi_checkgrad COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-checkgrad 1 )
625     add_test(NAME UNRES_M_multi_min COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-min 1 )
626     add_test(NAME UNRES_M_multi_microcanonical COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-micro 1 )
627     add_test(NAME UNRES_M_multi_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-ber 1 )
628     add_test(NAME UNRES_M_multi_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-lang 1 )
629   endif(UNRES_MD_FF STREQUAL "E0LL2Y")
630
631 else(NOT UNRES_WITH_MPI)
632
633
634   if(UNRES_MD_FF STREQUAL "GAB")
635     add_test(NAME UNRES_M_MD_MPI_Ala10 COMMAND ${mpiexec} ${boot_lam} ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
636   endif(UNRES_MD_FF STREQUAL "GAB")
637
638   if(UNRES_MD_FF STREQUAL "E0LL2Y")
639 # no NH in src_MD-M code
640     add_test(NAME UNRES_M_ENE_prota COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE_m 2 )
641     add_test(NAME UNRES_M_ENE1_prota COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE_m 1 )
642     add_test(NAME UNRES_M_CHECKGRAD_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh prota_CHECKGRAD 2 2 )   
643     add_test(NAME UNRES_M_CHECKGRAD1_prota COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_CHECKGRAD 1 )   
644     add_test(NAME UNRES_M_CHECKGRAD_homology COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh Ts866_checkgrad_full 2 2 )   
645     add_test(NAME UNRES_M_CHECKGRAD1_homology COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh Ts866_checkgrad_full 1 )   
646     add_test(NAME UNRES_M_MIN_prota COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_MIN_CART 2 )
647     add_test(NAME UNRES_M_MIN_INT COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_INT 1 )
648     add_test(NAME UNRES_M_REGULAR COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_REGULAR_INT 1 )
649     add_test(NAME UNRES_M_MD_microcanonical COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_micro 2 )
650     add_test(NAME UNRES_M_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_L 2 2 )
651 # no NH in src_MD-M code
652 ##    add_test(NAME UNRES_M_NoseHoover COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_NH 2 2 )
653     add_test(NAME UNRES_M_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_B 2 2 )
654     add_test(NAME UNRES_M_remd COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_remd 1 8 )
655     add_test(NAME UNRES_M_ss_static_min COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1ei0_min 1 2 )
656 #mutlichain
657     add_test(NAME UNRES_M_multi_ene COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-ene 2 2 )
658     add_test(NAME UNRES_M_multi_ene1 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-ene 1 1 )
659     add_test(NAME UNRES_M_multi_checkgrad COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-checkgrad 2 2 )
660     add_test(NAME UNRES_M_multi_checkgrad1 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-checkgrad 1 1 )
661     add_test(NAME UNRES_M_multi_min COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-min 2 2 )
662 #    add_test(NAME UNRES_M_multi_microcanonical COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-micro 2 2 )
663 #    add_test(NAME UNRES_M_multi_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-ber 2 2 )
664 #    add_test(NAME UNRES_M_multi_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-lang 2 2 )
665   endif(UNRES_MD_FF STREQUAL "E0LL2Y")
666
667 endif(NOT UNRES_WITH_MPI)
668