para_defs.py
def log(self, msg = '', flush = False):
        """ log messages from each proc and print on demand """
        if len(msg) > 0:
            self.msg += msg + '\n'
        if flush:
            if self.comm: 
                msgs = self.comm.gather(self.msg, root = 0)
                if self.comm.Get_rank() == 0:
                    for i, m in enumerate(msgs):
                        if len(m) > 0:
                            print('proc {0}:\n'.format(i) + m)
            else:
                print(self.msg)
            sys.stdout.flush()
            self.msg = ''
 log messages from each proc and print on demand 
log messages from each proc and print on demand
log messages from each proc and print on demand
def log(self, msg = '', flush = False):
        if len(msg) > 0:
            self.msg += msg + '\n'
        if flush:
            if self.comm: 
                msgs = self.comm.gather(self.msg, root = 0)
                if self.comm.Get_rank() == 0:
                    for i, m in enumerate(msgs):
                        if len(m) > 0:
                            print('proc {0}:\n'.format(i) + m)
            else:
                print(self.msg)
            sys.stdout.flush()
            self.msg = ''
def log ( self , msg = '' , flush = False ) : if len ( msg ) > 0 : self . msg += msg + '\n' if flush : if self . comm : msgs = self . comm . gather ( self . msg , root = 0 ) if self . comm . Get_rank ( ) == 0 : for i , m in enumerate ( msgs ) : if len ( m ) > 0 : print ( 'proc {0}:\n' . format ( i ) + m ) else : print ( self . msg ) sys . stdout . flush ( ) self . msg = ''
log messages from each proc and print on demand
log messages from each proc and print on demand
""" log messages from each proc and print on demand """
self
msg
flush