We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1f48b9 commit 40e69b2Copy full SHA for 40e69b2
fluidsim/util/util.py
@@ -279,10 +279,16 @@ def _path_file_from_time_approx(thing, t_approx):
279
if thing is not None and Path(thing).is_file():
280
path_file = Path(thing)
281
else:
282
- path_dir = pathdir_from_namedir(thing)
+ path_dir = Path(pathdir_from_namedir(thing))
283
# choose the file with the time closer to t_approx
284
- name_file = name_file_from_time_approx(path_dir, t_approx)
285
- path_file = Path(path_dir) / name_file
+ if mpi.rank == 0:
+ name_file = name_file_from_time_approx(path_dir, t_approx)
286
+ else:
287
+ name_file = None
288
+ if mpi.nb_proc > 1:
289
+ name_file = mpi.comm.bcast(name_file, root=0)
290
+
291
+ path_file = path_dir / name_file
292
return path_file
293
294
0 commit comments