IO500 / io500

IO500 Storage Benchmark source code
MIT License
95 stars 30 forks source link

rmdir is called from all ranks, and should be called only from rank 0 #29

Closed mchaarawi closed 3 years ago

mchaarawi commented 3 years ago

probably need something like:

diff --git a/src/util.c b/src/util.c
index fc3b449..ec4f5a6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -66,11 +66,12 @@ void u_call_cmd(char const * str){
   }
 }
 void u_purge_datadir(char const * dir){
-  char d[2048];
-  sprintf(d, "%s/%s", opt.datadir, dir);
-  DEBUG_INFO("Removing dir %s\n", d);
-
-  opt.aiori->rmdir(d, opt.backend_opt);
+  if( ! opt.dry_run && opt.rank == 0){
+    char d[2048];
+    sprintf(d, "%s/%s", opt.datadir, dir);
+    DEBUG_INFO("Removing dir %s\n", d);
+    opt.aiori->rmdir(d, opt.backend_opt);
+  }
 }

 void u_purge_file(char const * file){
JulianKunkel commented 3 years ago

I suppose an issue in cleanup was actually in the IOR easy where cleanup all procs accidentally is called. All other phases appear to have guarded properly.

mchaarawi commented 3 years ago

fwiw, that PR also resolve that issue. thanks!

adilger commented 3 years ago

Patch included in io500-isc21_v2 tag.