[gpaw-users] parallel IO

GENG SUN gengsun at ucla.edu
Sun Jul 21 19:15:19 CEST 2019


 Dear GPAW users,

I would like to do some preprocessing before running parallel GPAW
calculations.
The idea is to rewrite a "history.traj" into a list of separate
"input%d.traj" files if "history.traj" is found in the current folder. Here
is the script (test.py):

from ase.io import read, write
import sys
import os
from ase.parallel import rank,size,world,parprint
from gpaw import GPAW

checkpoint = "history.traj"

images = None

if os.path.isfile(checkpoint) and os.path.getsize(checkpoint) > 0:
    images = read(checkpoint, index="::1", format="traj")

world.barrier()

if rank == 0:
    if images is not None:
        for index in range(1000):
            fn = "input%d.traj" % index
            if index < len(images):
                write(fn, images[index])
            elif os.path.isfile(fn):
                os.remove(fn)
world.barrier()


My understanding is that after this script is executed, I can find a list
of files "input%d.traj" with the length of the checkpoint.

While when I run the script by mpirun -np 32 gpaw-python test.py, it never
finishes.

Then I  tested different numbers of processors. The script only runs
successfully with 2 processors and failed to finish with more than 2
processors.

Does anyone see any problem in this script?

Thank you very much. Any suggestions and help is greatly appreciated.

Best Wishes,

Geng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20190721/511af27a/attachment.html>


More information about the gpaw-users mailing list