import sys
sys.path.extend(['/home/aksenov/Simulation_wrapper/siman', '/home/aksenov/Simulation_wrapper/SSHTools'])
from SSHTools import SSHTools
import header
from calc_manage import add_loop, res_loop
from database import write_database, read_database
from set_functions import read_vasp_sets
from calc_manage import smart_structure_read
%matplotlib inline
Some module is used separately; default_project_conf.py is used
read_database()
header.PATH2PROJECT = 'topologic' # path to project relative to your home folder on cluster
header.PATH2POTENTIALS = '/home/aksenov/scientific_projects/PAW_PBE_VASP' #path to VASP POTENTIALS
header.varset['static'].potdir = {83:'Bi_pv', 34:'Se'} #subfolders with required potentials
header.ssh_object = SSHTools()
header.ssh_object.setup(user="aksenov",host="10.30.16.62",pkey="/home/aksenov/.ssh/id_rsa")
The function will:
add_loop('Bi2Se3', 'static', 1, input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR', it_folder = 'Bi2Se3', run = 0)
or using structure explicitly
st = smart_structure_read(input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR')
add_loop('Bi2Se3', 'static', 1, input_st = st, it_folder = 'Bi2Se3', run = 0)
The function get OUTCAR files from server and parse them
res_loop('Bi2Se3', 'static', 1)
-- name | energy(eV)| Vector lenghts (A) | Stresses (MPa) | N MD, N SCF -- Bi2Se3.static.1 | -20.1543 | 10.27;10.27;10.27 | -680,-680,-657 | 1,13, 13
(['Bi2Se3.static.1 | -20.1543 | 10.27;10.27;10.27 | -680,-680,-657 | 1,13, 13 '], [])
header.varset['static'].printme()
-- s.vasp_params['PREC'] = Normal -- s.vasp_params['NELM'] = 50 -- s.vasp_params['KSPACING'] = 0.235 -- s.vasp_params['LSCALU'] = .FALSE. -- s.vasp_params['NSW'] = 0 -- s.vasp_params['ISMEAR'] = 2 -- s.vasp_params['LREAL'] = Auto -- s.vasp_params['ENAUG'] = 776.16 -- s.vasp_params['SIGMA'] = 0.2 -- s.vasp_params['NELMIN'] = 4 -- s.vasp_params['ALGO'] = Normal -- s.vasp_params['NPAR'] = 1 -- s.vasp_params['LPLANE'] = .TRUE. -- s.vasp_params['NSIM'] = 4 -- s.vasp_params['ENCUT'] = 441.0 -- s.vasp_params['ISIF'] = 2 -- s.vasp_params['EDIFFG'] = 0 -- s.vasp_params['IBRION'] = 1 -- s.vasp_params['KGAMMA'] = .TRUE. -- s.vasp_params['MAXMIX'] = 40 -- s.vasp_params['ISTART'] = 0 -- s.vasp_params['EDIFF'] = 6e-06 -- POTDIR: {34: 'Se', 83: 'Bi_pv'}
read_vasp_sets([('ion_relax', 'static', {'ISIF':2, 'NSW':20, 'EDIFFG':-0.025}, 'override')]) #new set 'ion_relax' from 'static' with 'NSW' = 20
print('NSW = ', header.varset['ion_relax'].vasp_params['NSW'])
Attention! You have chosen to override set ion_relax Warning! You did not change ISIF in ion_relax set NSW = 20
add_loop('Bi2Se3', 'ion_relax', 1, input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR', run = 1) # no need
-- You provided the following geo file explicitly Bi2Se3_mp-541837_computed.POSCAR ; Version of file does not matter, I use *curver*= 1 as a new version -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.22 0.22 0.22] -- Attention! ngkpt = [8, 8, 8] is adopted from struct_des which you provided for it Bi2Se3 and kspacing = 0.235 Calculation ('Bi2Se3', 'ion_relax', 1) successfully created Submitted batch job 73576 JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) 73576 AMG Bi2Se3.i aksenov PD 0:00 1 (None) -- To read results use res_loop('Bi2Se3', ['ion_relax'], [1], show = 'fo' ) # , on 2016-11-24 ; possible options for show: fit, fo, fop, en, mag, magp, smag, maga, occ, occ1
'Bi2Se3'
calc = header.calc
res_loop('Bi2Se3', 'ion_relax', 1)
print('Relaxation energy = {:.6} meV'.format(1000*(calc['Bi2Se3','ion_relax', 1].energy_sigma0 - calc['Bi2Se3', 'static', 1].energy_sigma0)))
-- name | energy(eV)| Vector lenghts (A) | Stresses (MPa) | N MD, N SCF -- Bi2Se3.ion_relax.1 | -20.1552 | 10.27;10.27;10.27 | -521,-526,-367 | 20, 4, 89 Relaxation energy = -0.93545 meV
Make sure that ~/tools/fit_tool.py is on cluster;
siman/cluster_tools/fit_tool.py
add_loop('Bi2Se3', 'static', 1, calc_method = 'uniform_scale', scale_region = (-5, 5), run = 0)
-- Preparing uniform_scale calculation ... -- inherit_ngkpt(): the k-grid from Bi2Se3 was inherited to Bi2Se3.su -- Scale_region is (-5, 5) -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.1.geo was replaced -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.2.geo was replaced -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.3.geo was replaced -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.4.geo was replaced -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.5.geo was replaced -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.6.geo was replaced -- Warning! File ./Bi2Se3/Bi2Se3.su/Bi2Se3.su.auto_created_scaled_image.7.geo was replaced -- 7 uniform images have been created. -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.23 0.23 0.23] Calculation ('Bi2Se3.su', 'static', 1) successfully created -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.23 0.23 0.23] Calculation ('Bi2Se3.su', 'static', 2) successfully created -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.22 0.22 0.22] Calculation ('Bi2Se3.su', 'static', 3) successfully created -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.22 0.22 0.22] Calculation ('Bi2Se3.su', 'static', 4) successfully created -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.21 0.21 0.21] Calculation ('Bi2Se3.su', 'static', 5) successfully created -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.21 0.21 0.21] Calculation ('Bi2Se3.su', 'static', 6) successfully created -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.21 0.21 0.21] -- Attention! ngkpt = [8, 8, 8] is adopted from struct_des which you provided for it Bi2Se3.su and kspacing = 0.235 Calculation ('Bi2Se3.su', 'static', 7) successfully created
'Bi2Se3.su'
res_loop('Bi2Se3.su', 'static', list(range(1,8))+[100], up = 'up', show = 'fit', analys_type = 'fit_a')
-- name | energy(eV)| Vector lenghts (A) | Stresses (MPa) | N MD, N SCF -- Bi2Se3.su.static.1 | -19.4364 | 9.75;9.75;9.75 | 11309,11321,10881 | 1,12, 12 -- Bi2Se3.su.static.2 | -19.8495 | 9.92;9.92;9.92 | 6357,6365,6100 | 1,13, 13 -- Bi2Se3.su.static.3 | -20.0802 | 10.09;10.09;10.09 | 2443,2446,2330 | 1,13, 13 -- Bi2Se3.su.static.4 | -20.1543 | 10.27;10.27;10.27 | -680,-680,-657 | 1,13, 13 -- Bi2Se3.su.static.5 | -20.0988 | 10.44;10.44;10.44 | -3124,-3126,-3036 | 1,13, 13 -- Bi2Se3.su.static.6 | -19.9327 | 10.61;10.61;10.61 | -5000,-5005,-4839 | 1,13, 13 -- Bi2Se3.su.static.7 | -19.6756 | 10.78;10.78;10.78 | -6438,-6444,-6214 | 1,13, 13 -- Bi2Se3.su.static.100 | -20.1544 | 10.27;10.27;10.27 | -799,-800,-774 | 1,13, 13 v0 = 152.1046628510272 A^3 a0 = 5.338027939754267 A E0 = -20.15465796451467 eV B = 0.34134080321747523 eV/A^3
-- fit results are saved in figs/Bi2Se3.su.static.100.eps
(['Bi2Se3.su.static.100 | -20.1544 | 10.27;10.27;10.27 | -799,-800,-774 | 1,13, 13 '], [])
add_loop('Bi2Se3.su', 'ion_relax', 100, inherit_option = 'full', run = 0, override = 1)
Warning! final xred and xcart was used from OUTCAR and have low precision. Please use CONTCAR file -- Warning! File ./Bi2Se3/Bi2Se3.su.if/Bi2Se3.su.if.inherit.full.100.geo was replaced -- inherit_ngkpt(): the k-grid from Bi2Se3.su was inherited to Bi2Se3.su.if -- check_kpoints(): Kpoint mesh is: [8, 8, 8] -- check_kpoints(): The actual k-spacings are [ 0.22 0.22 0.22] -- Attention! ngkpt = [8, 8, 8] is adopted from struct_des which you provided for it Bi2Se3.su.if and kspacing = 0.235 Calculation ('Bi2Se3.su.if', 'static', 100) successfully created
'Bi2Se3.su.if'
res_loop('Bi2Se3.su.if', ['ion_relax'], [100], show = 'fo' ) #show forces
Max. F. tot (meV/A) = [78]; -- name | energy(eV)| Vector lenghts (A) | Stresses (MPa) | N MD, N SCF -- Bi2Se3.su.if.static.100 | -20.1544 | 10.27;10.27;10.27 | -799,-800,-774 | 1,13, 13
(['Bi2Se3.su.if.static.100 | -20.1544 | 10.27;10.27;10.27 | -799,-800,-774 | 1,13, 13 '], [])
add_loop('Bi2Se3.su', 'static', 100, inherit_option = 'supercell', run = 0, mul_matrix = [[2,0,0],[0,2,0],[0,0,2]])
-- inherit_icalc(): starting supercell mode ... rprimd of supercell [[ 8.2 0. 18.8] [ 3.9 7.2 18.8] [ 0. 0. 20.5]] The supercell should contain 40.0 40 atoms Number of atoms ... OK -- check_kpoints(): Kpoint mesh is: [4, 4, 4] -- check_kpoints(): The actual k-spacings are [ 0.22 0.22 0.22] -- Attention! ngkpt = [4, 4, 4] is adopted from struct_des which you provided for it Bi2Se3.su.s222 and kspacing = 0.235 Calculation ('Bi2Se3.su.s222', 'static', 100) successfully created
'Bi2Se3.su.s222'
The function creates several files called calc.gdbm3 and only_calc.gdbm3 in the current folder. On the next run the function read_database() will read them and you can access you results using res_loop() or calc dictionary
write_database()