[ase-users] multi-threads neglected by wannier calculation

Bing Huang hbdft2008 at gmail.com
Tue Nov 18 04:27:02 CET 2014


Hi, Marcin

My test results showed that when running multi-kpoints calculation with 
the parameter `initial set to true (it's OK if there is no 
initialization), error results:

Traceback (most recent call last):
   File "./run.Pt", line 43, in <module>
     wannier = 
Wannier(nwannier=6,fixedenergy=2.0,calc=calc,initialwannier=wannier0)
   File "/usr/local/lib/python2.6/site-packages/ase/dft/wannier.py", 
line 376, in __init__
     self.initialize(file=file, initialwannier=initialwannier, seed=seed)
   File "/usr/local/lib/python2.6/site-packages/ase/dft/wannier.py", 
line 414, in initialize
     self.edf_k, self.spin, self.nbands)
TypeError: initial_wannier() takes exactly 6 arguments (7 given)


It seems (if i remember well) that this issue has been addressed before 
and resolved for the old ASE2.

However, I've used the old Dacapo to calculate the MLWFs successfully 
and found that the obtained hopping matrix elements are all complex 
numbers. I suppose one should choose the module of the complex number as 
the strength of hopping matrix element. Is this right?  In PRB 56,12847 
Marzari and Vanderbilt conjecture that optimally localized Wannier 
functions are alway real then I suppose that the  hopping parameter must 
be real. How comes out complex?

Best regards,
Bing

PS: content of python script: run.Pt

#############################################################################!/usr/bin/env 
python2.6

# Localized Wannier orbitals for a Pt wire

from ase import *
from ase.dft import Wannier
from ase.dft.kpoints import monkhorst_pack
from ase.calculators.jacapo import *
from time import ctime
import os

# check if we have already calculated the nc file
if not os.path.isfile('pt.nc'):

     nprocs = 15

     os.environ['OMPI_PREFIX'] = '-n %d'%nprocs # set environment var 
OMPI_PREFIX="-n 24" for parallel computing
     os.environ['SCRATCH'] = '/scratch/tmp' # set environment var 
scratchdir for writing temporary files

     # Pt wire
     lat = 2.41
     atoms = Atoms([Atom('Pt', [0*lat, 2*lat, 2*lat])], 
cell=[lat,4*lat,4*lat], pbc=True)

     # displace kpoints slightly to neglect symmetry
     kpts = (15,1,1)
     kpts = monkhorst_pack(kpts)
     kpts[:,0] += 2e-5

     # Dacapo calculator:
     calc = Jacapo(nc='pt.nc', pw=350, kpts=kpts, nbands=8, xc='PBE')

     atoms.set_calculator(calc)

     tot = atoms.get_potential_energy()

# Wannier part

atoms = Jacapo.read_atoms('pt.nc')
calc = atoms.get_calculator()

#Initialize Wannier class
wannier0 = [ [[0], 2, 0.4], [[0.5,0.5,0.5], 0, 0.5]]
wannier = 
Wannier(nwannier=6,fixedenergy=2.0,calc=calc,initialwannier=wannier0)

# save
wannier.save('wannier_pt.pickle')
# Perform localization
wannier.localize()

wannier.translate_all_to_cell(cell=[1,0,0])

for n in range(6):
     wannier.write_cube(n,'pt_#'+str(n)+'.cube',real=True)
############################################################################


? 2014/11/14 18:57, Marcin Dulak ??:
> Hi,
>
> On 11/14/2014 10:36 AM, Bing Huang wrote:
>> Hi, ase users,
>> It's my experience that ASE2 could utilize multi-threads to speed up 
>> Wannier calculation in ASE2/DACAPO in my old platforms. Recently, i 
>> migrated to new platform (new hardware/software), but the 
>> multi-threads is totally neglected by Python. Could anybody give me a 
>> hint on how to make it work?
>>
>> PS: Multi-threading calculation is initiated at the step of MDMin 
>> minimization (which is a function in Numeric, called when doing 
>> Wannier calculation). i've compiled python2.4 with icc 13.1 (the 
>> option --without-gcc is not set and the --with-threads is enabled by 
>> default). The reason i don't utilize ase3 to do wannier calculation 
>> is that there are really a bunch of bugs with certain file missing.
> ASE2 is no longer supported.
> Please provide the failing ASE3 script + the error.
>
> Best regards,
>
> Marcin
>> Besides, gcc is not fully used to build python2.4 for the reason of 
>> errors listed below when calling wannier function:
>>
>>   File 
>> "/usr/local/lib/python2.4/site-packages/ASE/Utilities/Wannier/Wannier.py", 
>> line 62, in __init__
>>     self.CheckNumeric()
>>   File 
>> "/usr/local/lib/python2.4/site-packages/ASE/Utilities/Wannier/Wannier.py", 
>> line 100, in CheckNumeric
>>     raise 'LinearAlgebra.Heigenvectors fails'
>> LinearAlgebra.Heigenvectors fails
>>
>> Best regards,
>> Bing
>>
>>
>> _______________________________________________
>> ase-users mailing list
>> ase-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20141118/4dc364ee/attachment.html>


More information about the ase-users mailing list