[gpaw-users] Error from transformers.py when restarting a calculation

Jens Jørgen Mortensen jensj at fysik.dtu.dk
Thu May 20 10:13:09 CEST 2010


On Wed, 2010-05-19 at 20:28 +0200, Ask Hjorth Larsen wrote:
> Hi Peder
> 
> On Wed, 19 May 2010, Peder Olesen wrote:
> 
> > Hi all,
> > 
> > I'm attempting to calculate some electron-phonon coupling matrix elements,
> > and for that purpose I need to reuse a calculator. However, when I produce
> > the file calcUC.gpw using the script:
> >
> >       from ase import *
> >       from gpaw import *
> >       a = 3.5691245496
> >       b = a/2.
> >
> >       bulkUC = Atoms('C2',positions=([0,0,0],[b/2,b/2,b/2]),
> >       cell=([0,b,b],[b,0,b],[b,b,0]),pbc=False)
> >       bulkUC.set_pbc(True)
> >
> >       calcUC = GPAW(kpts=(20,20,20), xc='PBE', h=0.2,
> >       txt='calcUC.out', nbands=-1)
> >       bulkUC.set_calculator(calcUC)
> >       e=bulkUC.get_potential_energy()
> >       calcUC.write('calcUC.gpw')
> > 
> > 
> > ...and subsequently attempt to load it using any script with the lines
> > 
> > from gpaw import *
> > calcUC = GPAW('calcUC.gpw', txt='calcUC.out')
> > 
> > ...I recieve the following error whenever the the above lines are in a
> > script using n>23 cores
> >
> >       Traceback (most recent call last):
> >         File "mat_elem.py", line 2, in ?
> >           calcUC = GPAW('calcUC.gpw', txt='calcUC.out')
> >         File "/home/camp/s082073/gpaw/gpaw/paw.py", line 116, in
> >       __init__
> >           self.initialize()
> >         File "/home/camp/s082073/gpaw/gpaw/paw.py", line 571, in
> >       initialize
> >           magmom_a, par.hund)
> >         File "/home/camp/s082073/gpaw/gpaw/density.py", line 74, in
> >       initialize
> >           allocate=False)
> >         File "/home/camp/s082073/gpaw/gpaw/transformers.py", line 143,
> >       in Transformer
> >           t = _Transformer(gdin, gdout, nn, dtype, allocate)
> >         File "/home/camp/s082073/gpaw/gpaw/transformers.py", line 48,
> >       in __init__
> >           assert ((gdin.n_c[0] + 2 * nn - 1) * (gdin.n_c[1] + 2 * nn -
> >       1) <=
> >       AssertionError
> > 
> > 
> > If I do a dry-run=n with n=23 i get
> >
> >       Traceback (most recent call last):
> >         File "mat_elem.py", line 2, in ?
> >           calcUC = GPAW('calcUC.gpw', txt='calcUC.out')
> >         File "/home/camp/s082073/gpaw/gpaw/paw.py", line 116, in
> >       __init__
> >           self.initialize()
> >         File "/home/camp/s082073/gpaw/gpaw/paw.py", line 518, in
> >       initialize
> >           domain_comm, parsize)
> >         File "/home/camp/s082073/gpaw/gpaw/grid_descriptor.py", line
> >       124, in __init__
> >           raise ValueError('Grid too small!')
> >       ValueError: Grid too small!
> > 
> > 
> > whereas n<23 gives no problems at all. I would like to use n>23 cores for
> > some subsequent operations. Obviously the problem has something to do with
> > parallelization, but does anyone know in greater detail what the particular
> > reason the above errors might be, and what I should do to avoid them?
> > 
> > Thanks in advance,
> > Peder J. Olesen
> 
> Sounds like GPAW isn't too happy about using many CPUs for a small 
> calculation.

If you have 23 CPU's, GPAW will try to divide your 770 k-points in the
IBZ by 23 which doesn't work.  Then it will try to divide the 12*12*12
grid-points into 23 chunks which also doesn't work!  If you choose 40
CPU's, you will get 77 k-points and 6*6*12 grid-points on every CPU and
that should be fine.

It's on the to-do list to allow parallelization over k-points also when
the number of CPU's doesn't divide the number of k-points.

JJ

>   Try starting GPAW like this:
> 
> from gpaw.mpi import world
> 
> calc = GPAW(..., communicator=[world.rank], ...)
> 
> This will make the calculator exist individually and independently on each 
> process (you can also use some if-statements to make sure it only gets 
> created on one of them or so).  The communicator keyword can be set to any 
> set of ranks as necessary.
> 
> Regards
> Ask
> _______________________________________________ gpaw-users mailing list gpaw-users at listserv.fysik.dtu.dk https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users



More information about the gpaw-users mailing list