[gpaw-users] Error from transformers.py when restarting a
calculation
Ask Hjorth Larsen
askhl at fysik.dtu.dk
Wed May 19 20:28:34 CEST 2010
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. 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
More information about the gpaw-users
mailing list