diff --git a/hysop/tools/io_utils.py b/hysop/tools/io_utils.py index de637e606aff7fc11f643c999736b24f26f39532..4c989eda059aec0080ff5880956f0162fd1288ed 100755 --- a/hysop/tools/io_utils.py +++ b/hysop/tools/io_utils.py @@ -49,7 +49,10 @@ class IO(object): @requires_cmd('stat') def get_fs_type(path): cmd = ['stat', '-f', '-c', '%T', path] - fs_type = subprocess.check_output(cmd) + fs_type='' + if mpi.main_rank==0: + fs_type = subprocess.check_output(cmd) + fs_type = mpi.main_comm.bcast(fs_type, root=0) return fs_type.replace('\n', '') @classmethod @@ -148,7 +151,8 @@ class IO(object): raise RuntimeError(msg) if not os.path.exists(cpath): try: - os.makedirs(cpath) + if mpi.main_rank==0: + os.makedirs(cpath) except IOError: pass return cpath