示例#1
0
文件: Dumper.py 项目: edu159/mpidump
 def __init__(self, dump_name, dump_dir=".", compress=None):
     Compressor.__init__(self, compress)
     self.comms = {}
     self.dump_name = dump_name
     self.dump_dir = dump_dir
     self.process = MpiProcess()
     self._check_valid_compressor(compress)
     self._set_open()
     self.root_path = os.path.join(dump_dir, dump_name)
     self.procs_path = os.path.join(self.root_path, "procs")
     self.comms_path = os.path.join(self.root_path, "comms")
     if (MPI.COMM_WORLD.Get_rank() == 0):
         try:
             os.mkdir(self.root_path)
             os.mkdir(self.procs_path)
             os.mkdir(self.comms_path)
             self._create_ini_file()
         except Exception as e:
             print e
             MPI.COMM_WORLD.Abort()
     MPI.COMM_WORLD.Barrier()
示例#2
0
if __name__ == '__main__':
    from Compressor import Compressor
    compressor = Compressor('images/image4.bmp', 8, 8, 100, 200)
    compressor.process()