def _open(self, filename, mode): import ase.io.ulm as ulm if mode not in 'aw': raise ValueError('mode must be "w" or "a".') if self.master: self.backend = ulm.open(filename, mode, tag='ASE-Trajectory') if len(self.backend) > 0 and mode == 'a': atoms = Trajectory(filename)[0] self.header_data = get_header_data(atoms) else: self.backend = ulm.DummyWriter()
def _open(self, filename, mode): import ase.io.ulm as ulm if mode not in 'aw': raise ValueError('mode must be "w" or "a".') if self.master: self.backend = ulm.open(filename, mode, tag='ASE-Trajectory') if len(self.backend) > 0: r = ulm.open(filename) self.numbers = r.numbers self.pbc = r.pbc else: self.backend = ulm.DummyWriter()
def Writer(filename, world, tag='GPAW'): import ase.io.ulm as ulm if world.rank == 0: return ulm.Writer(filename, tag=tag) return ulm.DummyWriter()