Merge remote-tracking branch 'origin/release-4-6'
[alexxy/gromacs.git] / src / programs / mdrun / runner.c
index be455a7805d9c66ccd6cce0d2a350dda59f50a56..1025372f6a0c184ae10b30c34b434690f6988f42 100644 (file)
@@ -375,7 +375,7 @@ int mdrunner(int nthreads_requested, FILE *fplog,t_commrec *cr,int nfile,
     t_commrec   *cr_old=cr; 
     int         nthreads_mpi=1;
     int         nthreads_pme=1;
-    gmx_membed_t *membed=NULL;
+    gmx_membed_t membed=NULL;
 
     /* CAUTION: threads may be started later on in this function, so
        cr doesn't reflect the final parallel state right now */
@@ -429,9 +429,11 @@ int mdrunner(int nthreads_requested, FILE *fplog,t_commrec *cr,int nfile,
      * (in case we ever want to make it run in parallel) */
     if (opt2bSet("-membed",nfile,fnm))
     {
-        fprintf(stderr,"Initializing membed");
-        snew(membed,1);
-        init_membed(fplog,membed,nfile,fnm,mtop,inputrec,state,cr,&cpt_period);
+        if (MASTER(cr))
+        {
+            fprintf(stderr,"Initializing membed");
+        }
+        membed = init_membed(fplog,nfile,fnm,mtop,inputrec,state,cr,&cpt_period);
     }
 
     if (PAR(cr))