Commit b5e0c30f authored by Alvaro Vazquez Mayagoitia's avatar Alvaro Vazquez Mayagoitia
Browse files

split comm example

parent 0ec7d5d4
LIBAIMS=-L/home/vama/soft/chem2/fhi/devel/lib -laims.160620.scalapack.mpi
MPIRUN=/opt/intel/compilers_and_libraries_2016.1.150/linux/mpi/intel64/bin/mpirun
NODES=2
PYTHON=python
run:
/opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpirun -n 2 python ./callaims.py
${MPIRUN} -n ${NODES} ${PYTHON} ./callaims.py
aims_w.so: aims_w.f90
f2py --f90exec=mpif90 --fcompiler=intelem -m aims_w -c aims_w.f90 -L/home/vama/soft/chem2/fhi/devel/lib -laims.160620.scalapack.mpi
f2py --f90exec=mpif90 --fcompiler=intelem -m aims_w -c aims_w.f90 ${LIBAIMS}
clean:
rm aims_w.so
hello.so: hello.f90
f2py -c --fcompiler=gnu95 -m hello hello.f90 -L. -lcall
callcaca.x: libcall.so callcaca.f90
gfortran -c callcaca.f90 -o callcaca.o
gfortran -o callcaca.x callcaca.o -L. callcaca.o -lcall
libcall.so: caca.o
ld -o libcall.so.1 -dy -G -h libcall.so.1 caca.o
ln -s libcall.so.1 libcall.so
caca.o: caca.f90
gfortran -shared -fPIC -c -o caca.o caca.f90
clean:
rm *.o *.so *.x lib*
from mpi4py import MPI
import aims_w
comm = MPI.COMM_WORLD
world_size = comm.size
world_rank = comm.rank
commf = comm.py2f()
num_of_groups = 2
#consecutive processors
color = world_rank / num_of_groups
key = world_rank
newcomm = comm.Split( color , key )
newcomm_size = newcomm.size
newcomm_rank = newcomm.rank
newcommf = newcomm.py2f()
jobprefix="job"
job = 999
path= "9999 "
if (newcomm_rank == 0):
job = world_rank/2 + 1
path="./" + jobprefix + str(job) + "/"
path1 = newcomm.bcast(path, root=0)
for i in range ( world_size ) :
comm.Barrier()
if ( world_rank == i ) :
print " Global : rank % d of % d . New comm : rank % d of % d " % ( world_rank , world_size , newcomm_rank , newcomm_size )
print path1
aims_w.aims_w(newcommf, path1)
newcomm.Free()
#########################################################################################
#
# Volker Blum, FHI 2009 : Test run input file control.in for Au dimer
#
#########################################################################################
#
# Physical model
#
# xc pbe
# xc hf
xc pz-lda
spin none
charge 0.
#
# SCF convergence
#
occupation_type gaussian 0.01
mixer pulay
n_max_pulay 10
charge_mix_param 0.5
sc_accuracy_rho 1E-5
sc_accuracy_eev 1E-3
sc_accuracy_etot 1E-6
sc_accuracy_forces 1E-4
sc_iter_limit 20
#
#many_body_dispersion
#DFPT polarizability
#
# Relaxation
#
#
################################################################################
#
# FHI-aims code project
# VB, Fritz-Haber Institut, 2009
#
# Suggested "light" defaults for He atom (to be pasted into control.in file)
# Be sure to double-check any results obtained with these settings for post-processing,
# e.g., with the "tight" defaults and larger basis sets.
#
################################################################################
species He
# global species definitions
nucleus 2
mass 4.002602
#
l_hartree 4
#
cut_pot 3.5 1.5 1.0
basis_dep_cutoff 1e-4
#
radial_base 27 5.0
radial_multiplier 1
angular_grids specified
division 0.3349 110
division 0.4719 194
division 0.5352 302
# division 1.8809 770
# outer_grid 770
outer_grid 302
################################################################################
#
# Definition of "minimal" basis
#
################################################################################
# valence basis states
valence 1 s 2.
# ion occupancy
ion_occ 1 s 1.
################################################################################
#
# Suggested additional basis functions. For production calculations,
# uncomment them one after another (the most important basis functions are
# listed first).
#
# Constructed for dimers: 1.25 A, 1.75 A, 2.40 A, 3.25 A
#
# Noble gas symmetric dimers converge quickly in DFT. If you find that
# you require a larger basis than tier 2, please contact us - VB, FHI.
#
################################################################################
# "First tier" - improvements: -33.45 meV to -13.84 meV
hydro 1 s 0.85
hydro 2 p 3.5
# "Second tier" - improvements: -0.70 meV to -0.05 meV
# hydro 3 d 7.2
# hydro 3 s 3
# hydro 3 p 4.9
# hydro 4 f 12
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment