From 26f4da2c2e54e6b1bad2f055c4e4e76b5b877d05 Mon Sep 17 00:00:00 2001 From: Pawel Krupa Date: Fri, 17 Apr 2015 21:29:59 +0200 Subject: [PATCH] Fixed error caused by new MPICH2, which made WHAM-M non-usable. --- source/wham/src-M/enecalc1.F | 13 ++++++++----- source/wham/src-M/readrtns.F | 10 ++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/source/wham/src-M/enecalc1.F b/source/wham/src-M/enecalc1.F index 8e4fa74..16ae771 100644 --- a/source/wham/src-M/enecalc1.F +++ b/source/wham/src-M/enecalc1.F @@ -35,7 +35,7 @@ double precision tole /1.0d-1/ integer i,itj,ii,iii,j,k,l,licz integer ir,ib,ipar,iparm - integer iscor,islice + integer iscor,islice,scount_buff(0:99) real*4 csingle(3,maxres2) double precision energ double precision temp @@ -270,12 +270,15 @@ c & " snk",snk_p(iR,ib,ipar) 121 continue enddo #ifdef MPI - scount(me)=iii - write (iout,*) "Me",me," scount",scount(me) + scount_buff(me)=iii + write (iout,*) "Me",me," scount_buff",scount_buff(me) call flush(iout) c Master gathers updated numbers of conformations written by all procs. - call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount(0), 1, +c call MPI_AllGather(MPI_IN_PLACE,1,MPI_DATATYPE_NULL,scount(0),1, +c & MPI_INTEGER, WHAM_COMM, IERROR) + call MPI_AllGather( scount_buff(me), 1, MPI_INTEGER, scount(0), 1, & MPI_INTEGER, WHAM_COMM, IERROR) + indstart(0)=1 indend(0)=scount(0) do i=1, Nprocs-1 @@ -361,7 +364,7 @@ c------------------------------------------------------------------------------ double precision energ integer ilen,iroof external ilen,iroof - integer ir,ib,iparm + integer ir,ib,iparm, scount_buff(0:99) integer isecstr(maxres) write (licz2,'(bz,i2.2)') islice call opentmp(islice,ientout,bprotfile_temp) diff --git a/source/wham/src-M/readrtns.F b/source/wham/src-M/readrtns.F index 36c13b1..ded6c92 100644 --- a/source/wham/src-M/readrtns.F +++ b/source/wham/src-M/readrtns.F @@ -400,7 +400,7 @@ c------------------------------------------------------------------------------- external ilen,iroof double precision rmsdev,energia(0:max_ene),efree,eini,temp double precision prop(maxQ) - integer ntot_all(maxslice,0:maxprocs-1) + integer ntot_all(maxslice,0:maxprocs-1), maxslice_buff integer iparm,ib,iib,ir,nprop,nthr,npars double precision etot,time integer ixdrf,iret @@ -531,7 +531,13 @@ c DA scratchfile. #ifdef MPI c Check if everyone has the same number of conformations - call MPI_Allgather(stot(1),maxslice,MPI_INTEGER, + +c call MPI_ALLgather(MPI_IN_PLACE,stot(1),MPI_DATATYPE_NULL, +c & ntot_all(1,0),maxslice,MPI_INTEGER,MPI_Comm_World,IERROR) + + maxslice_buff=maxslice + + call MPI_Allgather(stot(1),maxslice_buff,MPI_INTEGER, & ntot_all(1,0),maxslice,MPI_INTEGER,MPI_Comm_World,IERROR) lerr=.false. do i=0,nprocs-1 -- 1.7.9.5