-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrunscript.py
More file actions
executable file
·75 lines (56 loc) · 2.75 KB
/
Copy pathrunscript.py
File metadata and controls
executable file
·75 lines (56 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# pylint: disable=too-many-arguments
from aiida.common.extendeddicts import AttributeDict
from aiida.orm import Code, Bool, Str, Dict, load_code
from aiida.orm.nodes.data import structure
from aiida.plugins import DataFactory, WorkflowFactory
from aiida.engine import submit, run
from aiida import load_profile
from Workchain_AmarantaTemplate_UniMiB import AmarantaWorkChain
import pymatgen.core.structure as pcs
import numpy as np
load_profile()
def main(code_string, structure, uuid_original_poscar, potential_family, potential_mapping, options):
"""Main method to set up the calculation."""
#dict_data = DataFactory('core.dict')
workchain = AmarantaWorkChain
inputs = AttributeDict()
#inputs.code = Code.get_from_string(code_string)
inputs.code = load_code(code_string)
inputs.structure = structure
inputs.uuid_original_poscar = Str(uuid_original_poscar)
inputs.potential_family = Str(potential_family)
#inputs.potential_mapping = dict_data(dict=potential_mapping)
inputs.potential_mapping = Dict(potential_mapping)
#settings = AttributeDict()
#settings.parser_settings = {'output_params': ['total_energies', 'maximum_force']}
#settings.parser_settings = {'add_site_magnetization':True, 'add_kpoints':True, 'add_structure':True}
#inputs.settings = dict_data(dict=settings)
#inputs.options = dict_data(dict=options)
inputs.options = Dict(options)
###'parameters' and 'kpoints' excluded from the exposed_inputs : expose_inputs(cls._next_workchain, exclude=['parameters','kpoints'])
### thus we avoid passing them to the workchain.
#inputs.parameters = dict_data(dict=incar)
#kpoints_data = DataFactory('core.array.kpoints')
#kpoints = kpoints_data()
#kpoints.set_kpoints_mesh(kmesh)
#inputs.kpoints = kpoints
inputs.verbose = Bool(True)
submit(workchain, **inputs)
if __name__ == '__main__':
CODE_STRING = 'vasp_ncl@leonardo'
filepath = './POSCAR_Ni1I2_1af4d6e8-83b9-4047-876b-d08eea71731d'
pcs_POSCAR = pcs.Structure.from_file(filepath)
STRUCTURE = structure.StructureData(pymatgen_structure=pcs_POSCAR)
UUID_ORIGINAL_POSCAR = filepath[-36:]
POTENTIAL_FAMILY = 'PP_632_GGA'
POTENTIAL_MAPPING = {'Ni': 'Ni_pv', 'I': 'I'}
# Jobfile:
OPTIONS = AttributeDict()
OPTIONS.account = 'IscrB_HEXTIM'
OPTIONS.qos = ''
OPTIONS.resources = {'num_machines': 8, 'num_mpiprocs_per_machine': 4}
OPTIONS.queue_name = ''
OPTIONS.max_wallclock_seconds = 7200
OPTIONS.max_memory_kb = 451000000
OPTIONS.custom_scheduler_commands = '#SBATCH --cpus-per-task=8\n#SBATCH --gres=gpu:4\n#SBATCH --partition=boost_usr_prod'
main(CODE_STRING, STRUCTURE, UUID_ORIGINAL_POSCAR, POTENTIAL_FAMILY, POTENTIAL_MAPPING, OPTIONS)