energy_dec works with etors_d
[unres.git] / source / unres / src_MD / chainbuild.F
index 45a1a53..235db7f 100644 (file)
@@ -5,6 +5,11 @@ C As of 2/17/95.
 C
       implicit real*8 (a-h,o-z)
       include 'DIMENSIONS'
+#ifdef MPI
+      include 'mpif.h'
+      include 'COMMON.SETUP'
+      include 'COMMON.TIME1'
+#endif
       include 'COMMON.CHAIN'
       include 'COMMON.LOCAL'
       include 'COMMON.GEO'
@@ -15,6 +20,24 @@ C
       logical lprn
 C Set lprn=.true. for debugging
       lprn = .false.
+#ifdef MPI
+      if (nfgtasks.gt.1) then
+       time00=MPI_Wtime()
+       if (fg_rank.eq.0)
+     &    call MPI_Bcast(13,1,MPI_INTEGER,king,FG_COMM,IERROR)
+       time01=MPI_Wtime()
+       call MPI_Bcast(phi(1),nres,MPI_DOUBLE_PRECISION,
+     &    king,FG_COMM,IERR)
+       call MPI_Bcast(theta(1),nres,MPI_DOUBLE_PRECISION,
+     &    king,FG_COMM,IERR)
+       call MPI_Bcast(alph(1),nres,MPI_DOUBLE_PRECISION,
+     &    king,FG_COMM,IERR)
+       call MPI_Bcast(omeg(1),nres,MPI_DOUBLE_PRECISION,
+     &    king,FG_COMM,IERR)
+       time_bcast=time_bcast+MPI_Wtime()-time00
+       time_bcastc=time_bcastc+MPI_Wtime()-time01
+      endif
+#endif
 C
 C Define the origin and orientation of the coordinate system and locate the
 C first three CA's and SC(2).