Skip to content
Snippets Groups Projects
Commit 5ef174f2 authored by Vadim Gubaidulin's avatar Vadim Gubaidulin
Browse files

- prevents print statements from occuring for every MPI rank

parent 33b912a2
No related branches found
No related tags found
1 merge request!280.8.0
......@@ -64,6 +64,9 @@ class Mpi:
self.MPI = MPI
self.comm = MPI.COMM_WORLD
self.rank = self.comm.Get_rank()
if self.rank != 0:
sys.stdout = open('/dev/null', 'w')
sys.stderr = open('/dev/null', 'w')
self.size = self.comm.Get_size()
self.write_table(filling_pattern)
......
  • Teresia Olsson @TeresiaOlsson ·
    Developer

    Hi @gubaidulinvadim, I found that this change also requires importing the sys module when I tried to run it. I had to add 4c54d8ac for it to work. Does it work for you without adding that import?

  • GUBAIDULIN @GUBAIDULIN ·
    Maintainer

    Hi @TeresiaOlsson, I must admit that I might not have tested this commit yet, as it is still in the develop branch. I haven't recreated a new container for my scripts with this version yet, so adding "sys" import is a good addition!

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment