Skip to content

Commit

Permalink
activate second kkr_imp_wc test
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Nov 21, 2024
1 parent 5ccb1a7 commit 1ba776e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 81 deletions.
Binary file added tests/data_dir/kkrimp_full_Ag_Cu_onsite.aiida
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/jukkr_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ else

# build kkrimp code
echo "build kkrimp"
git checkout BdG # use BdG branch to have new ALAT tolerance input
git checkout KKRIMP-BdG # use BdG branch to have new ALAT tolerance input
./install.py --program=kkrimp --compiler=gfortran --parallelization=serial
cd build/ && make -j4 && cp kkrflex.exe ../
cd ../..
Expand Down
161 changes: 81 additions & 80 deletions tests/workflows/test_kkrimp_full_wc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,86 +91,87 @@ def test_kkrimp_full_wc(
assert rms[-1] < 1.40


# @pytest.mark.timeout(900, method='thread')
# def test_kkrimp_full_Ag_Cu_onsite(
# clear_database_before_test, voronoi_local_code, kkrhost_local_code, kkrimp_local_code, enable_archive_cache
# ):
# """
# Simple Ag_Cu (bulk) noSOC, FP, lmax2 example where impurity cluster contains only the impurity atom
# """
# from aiida.orm import Code, load_node, Dict, StructureData, load_group
# from aiida.orm.querybuilder import QueryBuilder
# from masci_tools.io.kkr_params import kkrparams
# from aiida_kkr.workflows.kkr_imp import kkr_imp_wc
# from numpy import array

# # settings for workflow
# options, wfd, voro_aux_settings = kkr_imp_wc.get_wf_defaults()

# # workflow behavior
# wfd['nsteps'] = 10
# wfd['strmix'] = 0.05
# wfd['do_final_cleanup'] = False
# wfd['convergence_criterion'] = 10**-4
# # computer settings
# options = {
# 'queue_name': queuename,
# 'resources': {
# 'num_machines': 1
# },
# 'max_wallclock_seconds': 5 * 60,
# 'withmpi': False,
# 'custom_scheduler_commands': ''
# }
# options = Dict(options)
# # voronoi settings for impurity startpot
# voro_aux_settings['check_dos'] = False
# voro_aux_settings['natom_in_cls_min'] = 50
# voro_aux_settings['rclustz'] = 1.5

# # make cluster radius small so that only the impurity is inside
# imp_info = Dict({'Rcut': 3.5, 'ilayer_center': 0, 'Zimp': [47.]})

# # import parent calculation (converged host system)
# group_pk = import_with_migration('data_dir/kkr_scf_wc-nodes-31a2e00e231215133475de79d47f7c0b.tar.gz')
# for node in load_group(group_pk).nodes:
# if node.label == 'KKR-scf for Cu bulk':
# kkr_scf_wc = node
# kkr_converged = load_node(kkr_scf_wc.outputs.output_kkr_scf_wc_ParameterResults['last_calc_nodeinfo']['uuid'])
# kkrhost_calc_remote = kkr_converged.outputs.remote_folder

# # give workflow label and description
# label = 'kkrimp_scf full Cu host_in_host'
# descr = 'kkrimp_scf full workflow for Cu bulk inlcuding GF writeout and vorostart for starting potential'

# # create process builder to set parameters
# builder = kkr_imp_wc.get_builder()
# builder.metadata.description = descr
# builder.metadata.label = label
# builder.kkrimp = kkrimp_local_code
# builder.voronoi = voronoi_local_code
# builder.kkr = kkrhost_local_code
# builder.options = options
# builder.voro_aux_parameters = Dict(voro_aux_settings)
# builder.wf_parameters = Dict(wfd)
# builder.impurity_info = imp_info
# builder.remote_data_host = kkrhost_calc_remote
# builder.scf.params_overwrite = Dict({'TOL_ALAT_CHECK': 1e-8})

# # now run calculation
# with enable_archive_cache(data_dir / 'kkrimp_full_Ag_Cu_onsite.aiida'):
# out, node = run_get_node(builder)
# print(out)

# # check outcome
# n = out['workflow_info']
# n = n.get_dict()
# print(n)
# for sub in 'auxiliary_voronoi gf_writeout kkr_imp_sub'.split():
# assert sub in list(n.get('used_subworkflows').keys())

# kkrimp_sub = load_node(n['used_subworkflows']['kkr_imp_sub'])
# assert kkrimp_sub.outputs.workflow_info.get_dict().get('successful')
@pytest.mark.timeout(900, method='thread')
def test_kkrimp_full_Ag_Cu_onsite(
clear_database_before_test, voronoi_local_code, kkrhost_local_code, kkrimp_local_code, enable_archive_cache
):
"""
Simple Ag_Cu (bulk) noSOC, FP, lmax2 example with Lloyd where impurity cluster contains only the impurity atom
"""
from aiida.orm import Code, load_node, Dict, StructureData, load_group
from aiida.orm.querybuilder import QueryBuilder
from masci_tools.io.kkr_params import kkrparams
from aiida_kkr.workflows.kkr_imp import kkr_imp_wc
from numpy import array

# settings for workflow
options, wfd, voro_aux_settings = kkr_imp_wc.get_wf_defaults()

# workflow behavior
wfd['nsteps'] = 10
wfd['strmix'] = 0.05
wfd['do_final_cleanup'] = False
wfd['convergence_criterion'] = 10**-4
# computer settings
options = {
'queue_name': queuename,
'resources': {
'num_machines': 1
},
'max_wallclock_seconds': 5 * 60,
'withmpi': False,
'custom_scheduler_commands': ''
}
options = Dict(options)
# voronoi settings for impurity startpot
voro_aux_settings['check_dos'] = False
voro_aux_settings['natom_in_cls_min'] = 50
voro_aux_settings['rclustz'] = 1.5

# make cluster radius small so that only the impurity is inside
imp_info = Dict({'Rcut': 3.5, 'ilayer_center': 0, 'Zimp': [47.]})

# import parent calculation (converged host system)
group_pk = import_with_migration('data_dir/scf_wc_Cu_simple.aiida')
for node in load_group(group_pk).nodes:
if node.label == 'KKR-scf for Cu bulk':
kkr_scf_wc = node
kkr_converged = load_node(kkr_scf_wc.outputs.output_kkr_scf_wc_ParameterResults['last_calc_nodeinfo']['uuid'])
kkrhost_calc_remote = kkr_converged.outputs.remote_folder

# give workflow label and description
label = 'kkrimp_scf full Cu host_in_host'
descr = 'kkrimp_scf full workflow for Cu bulk inlcuding GF writeout and vorostart for starting potential'

# create process builder to set parameters
builder = kkr_imp_wc.get_builder()
builder.metadata.description = descr
builder.metadata.label = label
builder.kkrimp = kkrimp_local_code
builder.voronoi = voronoi_local_code
builder.kkr = kkrhost_local_code
builder.options = options
builder.voro_aux_parameters = Dict(voro_aux_settings)
builder.wf_parameters = Dict(wfd)
builder.impurity_info = imp_info
builder.remote_data_host = kkrhost_calc_remote
builder.scf.params_overwrite = Dict({'TOL_ALAT_CHECK': 1e-8})

# now run calculation
with enable_archive_cache(data_dir / 'kkrimp_full_Ag_Cu_onsite.aiida'):
out, node = run_get_node(builder)
print(out)

# check outcome
n = out['workflow_info']
n = n.get_dict()
print(n)
for sub in 'auxiliary_voronoi gf_writeout kkr_imp_sub'.split():
assert sub in list(n.get('used_subworkflows').keys())

kkrimp_sub = load_node(n['used_subworkflows']['kkr_imp_sub'])
assert kkrimp_sub.outputs.workflow_info.get_dict().get('successful')


#run test manually
if __name__ == '__main__':
Expand Down

0 comments on commit 1ba776e

Please sign in to comment.