Commit new changes 10/26/14
[unres.git] / source / unres / src_MD-NEWSC / MREMD.F
index 576e43d..0e4045f 100644 (file)
@@ -1828,6 +1828,7 @@ ctime        call flush(iout)
       integer*2 i_index
      &            (maxprocs/4,maxprocs/20,maxprocs/200,maxprocs/200)
       common /przechowalnia/ d_restart1
+      integer i2set_(0:maxprocs)
       write (*,*) "Processor",me," called read1restart"
 
          if(me.eq.king)then
@@ -1986,13 +1987,16 @@ c     &                (d_restart1(j,i+2*nres*il),j=1,3)
               enddo
              endif
 #endif
-              call mpi_scatter(i2set,1,mpi_integer,
-     &           iset,1,mpi_integer,king,
-     &           CG_COMM,ierr) 
-
+c Corrected AL 8/19/2014: each processor needs whole iset array not only its
+c own element
+c              call mpi_scatter(i2set,1,mpi_integer,
+c     &           iset,1,mpi_integer,king,
+c     &           CG_COMM,ierr) 
+              call mpi_bcast(i2set(0),nodes,mpi_integer,king,
+     &         CG_COMM,ierr)
+              iset=i2set(me)
            endif
 
-
         if(me.eq.king) close(irest2)
         return
         end