Skip to content
Snippets Groups Projects
Commit 65f5ea78 authored by Alexis GAMELIN's avatar Alexis GAMELIN
Browse files

[Fix] ProfileMonitor

Set hdf5 file to "a" mode fix an issue where the ProfileMonitor in MPI mode hung when writing data.
Remove flushing in ProfileMonitor.write() to avoid hung issuse in MPI mode.
parent fbc05566
Branches
Tags
No related merge requests found
......@@ -121,10 +121,10 @@ class Monitor(Element, metaclass=ABCMeta):
if len(self._file_storage) == 0:
if mpi_mode == True:
from mpi4py import MPI
f = hp.File(self.file_name, "w", libver='earliest',
f = hp.File(self.file_name, "a", libver='earliest',
driver='mpio', comm=MPI.COMM_WORLD)
else:
f = hp.File(self.file_name, "w", libver='earliest')
f = hp.File(self.file_name, "a", libver='earliest')
self._file_storage.append(f)
else:
raise ValueError("File is already open.")
......@@ -669,7 +669,6 @@ class ProfileMonitor(Monitor):
self.write_count * self.buffer_size:(self.write_count+1) *
self.buffer_size] = self.__getattribute__(dim + "_bin")
self.file.flush()
self.write_count += 1
def track(self, object_to_save):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment