示例#1
0
    def __init__(self, handle):
        """Constructor.
        """
        # Transfer responsibility of memory management from module to this
        # class.
        handle.disown()

        self.handle = handle
        self.rank = mpimodule.rank(self.handle)
        self.size = mpimodule.size(self.handle)
        return
示例#2
0
 def __init__(self, handle):
   """
   Constructor.
   """
   # Transfer responsibility of memory management from module to this
   # class.
   handle.disown()
   
   self.handle = handle
   self.rank = mpimodule.rank(self.handle)
   self.size = mpimodule.size(self.handle)
   return
示例#3
0
 def open(self):
   self.iupdate = None
   self.datetimeStart = datetime.datetime.now()
   
   try:
     import pylith.mpi.mpi as mpi
     self.isMaster = 0 == mpi.rank()
   except:
     self.isMaster = True
   if self.isMaster:
     self._open()
   return
示例#4
0
 def open(self):
   self.iupdate = None
   self.datetimeStart = datetime.datetime.now()
   
   try:
     import pylith.mpi.mpi as mpi
     self.isMaster = 0 == mpi.rank()
   except:
     self.isMaster = True
   if self.isMaster:
     self._open()
   return
示例#5
0
    def _createPath(self):
        """Create path for filename if it doesn't exist.
        """
        import os
        import pylith.mpi.mpi as mpi

        relpath = os.path.dirname(self.filename)
        if relpath and not os.path.exists(relpath):
            # Only create directory on master
            isMaster = 0 == mpi.rank()
            if isMaster:
                os.makedirs(relpath)
        return