From ebc5922b3ab7777d202a4c913209c17392664c7e Mon Sep 17 00:00:00 2001 From: Nicholas Higginbottom Date: Fri, 29 Aug 2014 11:05:01 +0100 Subject: [PATCH] Put check around windsave command in python, so only rank0 writes --- python.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/python.c b/python.c index a79eb5ba2..7a033f35e 100755 --- a/python.c +++ b/python.c @@ -2113,14 +2113,24 @@ run -- 07jul -- ksl JM1304: moved geo.wcycle++ after xsignal to record cycles correctly. First cycle is cycle 0. */ /* NSH1306 - moved geo.wcycle++ back, but moved the log and xsignal statements */ - Log_silent ("Saved wind structure in %s after cycle %d\n", windsavefile, - geo.wcycle); xsignal (root, "%-20s Finished %d of %d ionization cycle \n", "OK", geo.wcycle, wcycles); geo.wcycle++; //Increment ionisation cycles +/* NSH 1408 - The wind save command was not inside the ifdef statement, and so many processors tried to access the same file. This is fixed below */ + +#ifdef MPI_ON + if (rank_global == 0) + { +#endif wind_save (windsavefile); + Log_silent ("Saved wind structure in %s after cycle %d\n", windsavefile, + geo.wcycle); +#ifdef MPI_ON + } + MPI_Barrier(MPI_COMM_WORLD); +#endif @@ -2312,7 +2322,7 @@ run -- 07jul -- ksl geo.pcycle++; // Increment the spectral cycles -#ifdef MPI_ON +#ifdef MPI_ON if (rank_global == 0) { #endif