From: Cezary Czaplewski Date: Mon, 18 Feb 2013 12:52:01 +0000 (+0100) Subject: dynamic dissulfides with finegrain parallelization cont. X-Git-Tag: v.3.2~14 X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?p=unres.git;a=commitdiff_plain;h=29858260fdd1ede4a6a430ee7883f998abaac045 dynamic dissulfides with finegrain parallelization cont. --- diff --git a/bin/unres/MD/unres_ifort_MPICH_GAB.exe b/bin/unres/MD/unres_ifort_MPICH_GAB.exe index c8defa0..811cde3 100755 Binary files a/bin/unres/MD/unres_ifort_MPICH_GAB.exe and b/bin/unres/MD/unres_ifort_MPICH_GAB.exe differ diff --git a/source/unres/src_MD/cinfo.f b/source/unres/src_MD/cinfo.f index 5d23d6b..6877f3d 100644 --- a/source/unres/src_MD/cinfo.f +++ b/source/unres/src_MD/cinfo.f @@ -1,10 +1,10 @@ C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C -C 3 1 92 +C 3 1 98 subroutine cinfo include 'COMMON.IOUNITS' write(iout,*)'++++ Compile info ++++' - write(iout,*)'Version 3.1 build 92' - write(iout,*)'compiled Mon Feb 18 04:11:12 2013' + write(iout,*)'Version 3.1 build 98' + write(iout,*)'compiled Mon Feb 18 13:44:21 2013' write(iout,*)'compiled by czarek@piasek3' write(iout,*)'OS name: Linux ' write(iout,*)'OS release: 2.6.32-42-generic ' diff --git a/source/unres/src_MD/energy_p_new_barrier.F b/source/unres/src_MD/energy_p_new_barrier.F index 2557051..a2eb0f9 100644 --- a/source/unres/src_MD/energy_p_new_barrier.F +++ b/source/unres/src_MD/energy_p_new_barrier.F @@ -134,7 +134,7 @@ C cmc cmc Sep-06: egb takes care of dynamic ss bonds too cmc - if (dyn_ss) call dyn_set_nss +c if (dyn_ss) call dyn_set_nss c print *,"Processor",myrank," computed USCSC" #ifdef TIMING @@ -331,6 +331,7 @@ C energia(23)=evdw_m c print *," Processor",myrank," calls SUM_ENERGY" call sum_energy(energia,.true.) + if (dyn_ss) call dyn_set_nss c print *," Processor",myrank," left SUM_ENERGY" #ifdef TIMING #ifdef MPI diff --git a/source/unres/src_MD/ssMD.F b/source/unres/src_MD/ssMD.F index dc205be..bf1a9b3 100644 --- a/source/unres/src_MD/ssMD.F +++ b/source/unres/src_MD/ssMD.F @@ -512,9 +512,13 @@ c implicit none c Includes include 'DIMENSIONS' +#ifdef MPI + include "mpif.h" +#endif include 'COMMON.SBRIDGE' include 'COMMON.CHAIN' include 'COMMON.IOUNITS' + include 'COMMON.SETUP' #ifndef CLUST #ifndef WHAM include 'COMMON.MD' @@ -528,7 +532,8 @@ c Local variables & allihpb(maxdim),alljhpb(maxdim), & newnss,newihpb(maxdim),newjhpb(maxdim) logical found - + integer i_newnss(max_fg_procs),displ(max_fg_procs) + integer g_newihpb(maxdim),g_newjhpb(maxdim),g_newnss allnss=0 do i=1,nres-1 @@ -576,6 +581,35 @@ cmc write(iout,*)"ALLNSS ",allnss,(allihpb(i),alljhpb(i),i=1,allnss) newjhpb(newnss)=alljhpb(i) endif enddo + + if (nfgtasks.gt.1)then + + call MPI_Reduce(newnss,g_newnss,1, + & MPI_INTEGER,MPI_SUM,king,FG_COMM,IERR) + call MPI_Gather(newnss,1,MPI_INTEGER, + & i_newnss,1,MPI_INTEGER,king,FG_COMM,IERR) + displ(0)=0 + do i=1,nfgtasks-1,1 + displ(i)=i_newnss(i-1)+displ(i-1) + enddo + call MPI_Gatherv(newihpb,newnss,MPI_INTEGER, + & g_newihpb,i_newnss,displ,MPI_INTEGER, + & king,FG_COMM,IERR) + call MPI_Gatherv(newjhpb,newnss,MPI_INTEGER, + & g_newjhpb,i_newnss,displ,MPI_INTEGER, + & king,FG_COMM,IERR) + if(fg_rank.eq.0) then +c print *,'g_newnss',g_newnss +c print *,'g_newihpb',(g_newihpb(i),i=1,g_newnss) +c print *,'g_newjhpb',(g_newjhpb(i),i=1,g_newnss) + newnss=g_newnss + do i=1,newnss + newihpb(i)=g_newihpb(i) + newjhpb(i)=g_newjhpb(i) + enddo + endif + endif + diff=newnss-nss cmc write(iout,*)"NEWNSS ",newnss,(newihpb(i),newjhpb(i),i=1,newnss)