From 5e3aaf3aa633c894a1579c71333392ab38bc48fe Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Fri, 24 Jul 2015 17:56:37 -0600
Subject: [PATCH] Added barriers

It seems that sometime on travis a regtest with mw-mpi crashes.

I think this is because when using multiple processors per walker
there is a problem in the opening of the old file (for read) and
its backup (for write). Adding this barrier seems to make it more robust
---
 src/bias/MetaD.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bias/MetaD.cpp b/src/bias/MetaD.cpp
index c2213be11..a558268b1 100644
--- a/src/bias/MetaD.cpp
+++ b/src/bias/MetaD.cpp
@@ -658,6 +658,9 @@ last_step_warn_grid(0)
    }
   }
 
+  comm.Barrier();
+  if(comm.Get_rank()==0) multi_sim_comm.Barrier();
+
 // open hills file for writing
   hillsOfile_.link(*this);
   hillsOfile_.open(ifilesnames[mw_id_]);
-- 
GitLab