- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c3 cThis file contains the main (PARALLEL TEMPERING JOBS ONLY,4 CFOR SINGULAR PROCESSOR JOBS USE main)5 C6 CThis file contains also the subroutine: p_init_molecule7 c8 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,9 cShura Hayryan, Chin-Ku10 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,11 cJan H. Meinke, Sandipan Mohanty12 c13 CCALLS init_energy,p_init_molecule,partem_p14 C15 c**************************************************************1 ! ************************************************************** 2 ! 3 ! This file contains the main (PARALLEL TEMPERING JOBS ONLY, 4 ! FOR SINGULAR PROCESSOR JOBS USE main) 5 ! 6 ! This file contains also the subroutine: p_init_molecule 7 ! 8 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 9 ! Shura Hayryan, Chin-Ku 10 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 11 ! Jan H. Meinke, Sandipan Mohanty 12 ! 13 ! CALLS init_energy,p_init_molecule,partem_p 14 ! 15 ! ************************************************************** 16 16 program pmain 17 17 … … 28 28 logical newsta 29 29 30 cc Number of replicas30 !c Number of replicas 31 31 integer num_replica 32 cc Number of processors per replica32 !c Number of processors per replica 33 33 integer num_ppr 34 cc Range of processor for crating communicators34 !c Range of processor for crating communicators 35 35 integer proc_range(3) 36 cc Array of MPI groups36 !c Array of MPI groups 37 37 integer group(MAX_REPLICA), group_partem 38 cc Array of MPI communicators38 !c Array of MPI communicators 39 39 integer comm(MAX_REPLICA), partem_comm 40 cc Array of nodes acting as masters for the energy calculation.40 !c Array of nodes acting as masters for the energy calculation. 41 41 integer ranks(MAX_REPLICA) 42 cc Configuration switch42 !c Configuration switch 43 43 integer switch 44 44 integer rep_id 45 cset number of replicas45 ! set number of replicas 46 46 double precision eols(MAX_REPLICA) 47 47 … … 50 50 51 51 52 cMPI stuff, and random number generator initialisation52 ! MPI stuff, and random number generator initialisation 53 53 54 54 call mpi_init(ierr) … … 61 61 call sgrnd(seed) ! Initialize the random number generator 62 62 63 c=================================================== Energy setup63 ! =================================================== Energy setup 64 64 libdir='SMMP/' 65 cDirectory for SMMP libraries66 67 cThe switch in the following line is now not used.65 ! Directory for SMMP libraries 66 67 ! The switch in the following line is now not used. 68 68 flex=.false. ! .true. for Flex / .false. for ECEPP 69 69 70 cChoose energy type with the following switch instead ...70 ! Choose energy type with the following switch instead ... 71 71 ientyp = 0 72 c0 => ECEPP2 or ECEPP3 depending on the value of sh273 c1 => FLEX74 c2 => Lund force field75 c3 => ECEPP with Abagyan corrections76 c72 ! 0 => ECEPP2 or ECEPP3 depending on the value of sh2 73 ! 1 => FLEX 74 ! 2 => Lund force field 75 ! 3 => ECEPP with Abagyan corrections 76 ! 77 77 78 78 sh2=.false. ! .true. for ECEPP/2; .false. for ECEPP3 … … 87 87 call init_energy(libdir) 88 88 89 ccalculate CPU time using MPI_Wtime()89 ! calculate CPU time using MPI_Wtime() 90 90 startwtime = MPI_Wtime() 91 91 92 92 93 c================================================= Structure setup93 ! ================================================= Structure setup 94 94 grpn = 'nh2' ! N-terminal group 95 95 grpc = 'cooh' ! C-terminal group … … 121 121 ntlml = 0 122 122 123 cDecide if and when to use BGS, and initialize Lund data structures123 ! Decide if and when to use BGS, and initialize Lund data structures 124 124 bgsprob=0.6 ! Prob for BGS, given that it is possible 125 cupchswitch= 0 => No BGS 1 => BGS with probability bgsprob126 c2 => temperature dependent choice125 ! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 126 ! 2 => temperature dependent choice 127 127 upchswitch=1 128 128 rndord=.true. 129 129 if (ientyp.eq.2) call init_lundff 130 c=================================================================131 cDistribute nodes to parallel tempering tasks132 cI assume that the number of nodes available is an integer133 cmultiple n of the number of replicas. Each replica then gets n134 cprocessors to do its energy calculation.130 ! ================================================================= 131 ! Distribute nodes to parallel tempering tasks 132 ! I assume that the number of nodes available is an integer 133 ! multiple n of the number of replicas. Each replica then gets n 134 ! processors to do its energy calculation. 135 135 num_ppr = num_proc / num_replica 136 136 137 137 call mpi_comm_group(mpi_comm_world, group_world, error) 138 138 139 cThe current version doesn't require a separate variable j. I140 ccould just use i * num_ppr but this way it's more flexible.139 ! The current version doesn't require a separate variable j. I 140 ! could just use i * num_ppr but this way it's more flexible. 141 141 j = 0 142 142 do i = 1, num_replica … … 163 163 enddo 164 164 165 cSetup the communicator used for parallel tempering165 ! Setup the communicator used for parallel tempering 166 166 write (*,*) "PTGroup=", ranks(:num_replica) 167 167 call flush(6) … … 194 194 nml = 1 195 195 196 cRRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD196 ! RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD 197 197 call rmsinit(nml,'EXAMPLES/1bdd.pdb') 198 cRRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD198 ! RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD 199 199 200 200 ! READ REFERENCE CONTACT MAP … … 211 211 end do 212 212 213 c======================================== start of parallel tempering run213 ! ======================================== start of parallel tempering run 214 214 write (*,*) "There are ", no, 215 215 & " processors available for ",rep_id … … 220 220 call partem_p(num_replica, nequi, nswp, nmes, nsave, newsta, 221 221 & switch, rep_id, partem_comm) 222 c======================================== end of parallel tempering run223 ccalculate CPU time using MPI_Wtime()222 ! ======================================== end of parallel tempering run 223 ! calculate CPU time using MPI_Wtime() 224 224 endwtime = MPI_Wtime() 225 225 … … 236 236 enddo 237 237 238 c======================================== End of main238 ! ======================================== End of main 239 239 CALL mpi_finalize(ierr) 240 240
Note:
See TracChangeset
for help on using the changeset viewer.