From 8208a6ceb5544bd77236c601ceeff13e0b6fa25d Mon Sep 17 00:00:00 2001 From: ctena Date: Wed, 13 Mar 2019 18:21:22 +0100 Subject: [PATCH 1/2] Added barrier when writing the grid shapefile to make sure that all the process have their own grid shapefile. --- hermesv3_gr/modules/grids/grid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hermesv3_gr/modules/grids/grid.py b/hermesv3_gr/modules/grids/grid.py index 9263e64..f090e7e 100644 --- a/hermesv3_gr/modules/grids/grid.py +++ b/hermesv3_gr/modules/grids/grid.py @@ -531,6 +531,7 @@ class Grid(object): settings.write_log('\t\tGrid shapefile already done. Lets try to read it.', level=3) gdf = gpd.read_file(self.shapefile_path) + settings.comm.Barrier() settings.write_time('Grid', 'to_shapefile', timeit.default_timer() - st_time, level=1) return gdf -- GitLab From b226bbd9ef7a38feb51412fe3ca969dda25c3e34 Mon Sep 17 00:00:00 2001 From: ctena Date: Wed, 13 Mar 2019 18:24:44 +0100 Subject: [PATCH 2/2] Added barrier when creating shapefile folder --- hermesv3_gr/modules/grids/grid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hermesv3_gr/modules/grids/grid.py b/hermesv3_gr/modules/grids/grid.py index f090e7e..2669dd1 100644 --- a/hermesv3_gr/modules/grids/grid.py +++ b/hermesv3_gr/modules/grids/grid.py @@ -411,6 +411,7 @@ class Grid(object): if settings.rank == 0: if not os.path.exists(self.shapefile_path): os.makedirs(self.shapefile_path) + settings.comm.Barrier() if full_grid: self.shapefile_path = os.path.join(self.shapefile_path, 'grid_shapefile.shp') else: -- GitLab