Open cindytsai opened 2 years ago
Is it possible to move save()
function inside if yt.is_root()
by changing the code in yt
.
io.py
for empty list when saving figures.
io.py
in save
function is empty.
save()
calls libytIO. And also, how does it know at what operation should it calls libytIO.ParallelAnalysisInterface
class.
is_root
and only_on_root
.This is the easiest way, but we will need to give up its performance. We do this by making the write-to-file part in save
only works on root rank. Namely, only root rank can write to disk, and the other rank does the redundant operation except libyt dataIO.
save
inside is_root
and only_on_root
, but instead of returning None
on non-root rank, we make the other rank wait at libyt dataIO.This is the original method, but it doesn't seem that simple at all. Because there are dataIO separating everywhere in the code, it is nearly impossible to backtrace all the operations that need dataIO, not to mention that we need to let yt
know when should it wait at libyt dataIO. And this seems to be save
function specific, not a general approach.
If we wish to make it more general under these constraints, we need to find a way to make root rank calls an interruption at other rank, so that they know when should they be at libyt dataIO.
is_root
or only_on_root
?
Check
yt
Save FunctionDescription
In inline script, we need
save()
outside theif yt.is_root()
clause, becauseannotate_cquiver
(and other annotations) makessave
does data IO. When doing data IO inlibyt
(using function insideio.py
), each MPI rank must call the same method. See:31
26
Sometimes, there will be some missing figure in the output series of figures. This may happen if each rank is writing and creating a file with identical name. (link)