from aiida_fleur.calculation.fleur import FleurCalculation from aiida_fleur.tools.common_fleur_wf import get_inputs_fleur, get_inputs_inpgen __copyright__ = (u"Copyright (c), 2016, Forschungszentrum Jülich GmbH, " "IAS-1/PGI-1, Germany. All rights reserved.") __license__ = "MIT license, see LICENSE.txt file" __version__ = "0.27" __contributors__ = "Jens Broeder" RemoteData = DataFactory('remote') StructureData = DataFactory('structure') ParameterData = DataFactory('parameter') #FleurInpData = DataFactory('fleurinp.fleurinp') FleurInpData = DataFactory('fleur.fleurinp') FleurProcess = FleurCalculation.process() FleurinpProcess = FleurinputgenCalculation.process() class fleur_scf_wc(WorkChain): """ This workflow converges a FLEUR calculation (SCF). It converges the charge density and optional the total energy Two paths are possible: (1) Start from a structure and run the inpgen first (2) Start from a Fleur calculation, with optional remoteData :Params: wf_parameters: parameterData node, :Params: structure : structureData node, :Params: calc_parameters: parameterData node,
} }) #elements = list(s.get_symbols_set()) ## For remote codes, it is not necessary to manually set the computer, ## since it is set automatically by new_calc #computer = code.get_remote_computer() #calc = code.new_calc(computer=computer) calc = code.new_calc() #calc = CalculationFactory('fleur.inpgen') print calc, type(calc) calc.label = "Test Fleur inpgen" calc.description = "Test calculation of the Fleur input generator" calc.set_max_wallclock_seconds(300) # 5 min # Valid only for Slurm and PBS (using default values for the # number_cpus_per_machine), change for SGE-like schedulers calc.set_resources({"num_machines": 1}) calc.set_withmpi(False) calc.use_code(code) ## Otherwise, to specify a given # of cpus per machine, uncomment the following: # calc.set_resources({"num_machines": 1, "num_mpiprocs_per_machine": 8}) calc.set_resources({"tot_num_mpiprocs": 1}) #calc.set_custom_scheduler_commands("#SBATCH --account=ch3") calc.set_custom_scheduler_commands("#BSUB -P jara0043 \n#BSUB -x") if queue is not None: calc.set_queue_name(queue)
'gmaxxc': 12.5, 'gmax': 15.0 }, 'kpt': { 'div1': 17, 'div2': 17, 'div3': 17, 'tkb': 0.0005 } }) # now run an inputgen calculation: code = Code.get_from_string(codename) computer = Computer.objects.get(computer_name) JobCalc = FleurinputgenCalculation.process() attrs = { 'max_wallclock_seconds': 180, 'resources': { 'num_machines': 1 }, 'withmpi': False, #'computer': computer } inp = {'structure': s, 'parameters': parameters, 'code': code} f = run(JobCalc, _options=attrs, **inp) fleurinp = f['fleurinpData'] fleurinpd = load_node(fleurinp.pk)
structures = [Fe_structrure, Ni_structrure, Co_structrure] # create a parameters Dict parameters = Dict(dict={ 'comp': { 'kmax': 3.85 }, 'kpt': { 'div1': 4, 'div2' : 4, 'div3' : 1 }}) # options options = {'resources' : {"num_machines": 1, "num_mpiprocs_per_machine" : 1}, 'withmpi' : False} for structure in structures: # assemble inputs in a single dictionary inputs = FleurinputgenCalculation.get_builder() inputs.parameters = parameters inputs.code = inpgen_code inputs.structure = structure inputs.metadata.options = options # submit inpgen_pk = submit(FleurinputgenCalculation, **inputs) print('The PK of submitted inpgen job is {} for {} structure'.format(res_pk, structure.formula)
} }) #s=load_node(5814) #elements = list(s.get_symbols_set()) ## For remote codes, it is not necessary to manually set the computer, ## since it is set automatically by new_calc #computer = code.get_remote_computer() #calc = code.new_calc(computer=computer) calc = code.new_calc() #calc = CalculationFactory('fleur.inpgen') print(calc, type(calc)) calc.label = 'Test Fleur inpgen' calc.description = 'Test calculation of the Fleur input generator' calc.set_max_wallclock_seconds(300) # 5 min # Valid only for Slurm and PBS (using default values for the # number_cpus_per_machine), change for SGE-like schedulers calc.set_resources({'num_machines': 1}) calc.set_withmpi(False) calc.use_code(code) ## Otherwise, to specify a given # of cpus per machine, uncomment the following: calc.set_resources({'num_machines': 1, 'num_mpiprocs_per_machine': 8}) #calc.set_resources({"tot_num_mpiprocs" : 1}) #calc.set_custom_scheduler_commands("#SBATCH --account=ch3") #calc.set_custom_scheduler_commands("#BSUB -P jara0043 \n#BSUB -x") if queue is not None: calc.set_queue_name(queue)
'comp': { 'kmax': 3.5, 'gmax': 2.9, }, 'kpt': { 'nkpt': 200, } }) #s=load_node(5814) #elements = list(s.get_symbols_set()) ## For remote codes, it is not necessary to manually set the computer, ## since it is set automatically by new_calc #computer = code.get_remote_computer() #calc = code.new_calc(computer=computer) calc = FleurinputgenCalculation() #print calc #calc.label = 'Test inpgen run' print('set label {}'.format(calc.label)) JobCalc = calc.process() print(JobCalc.calc) print(JobCalc) #print(JobCalc.label) #JobCalc.calc.label = 'Test inpgen run' #print(JobCalc.calc) #print(JobCalc.label) label = 'Test inpgen run' description = 'Test inpgen run on W' label = 'fleur_scf_wc inpgen on W' description = '|fleur_scf_wc| inpgen on W, pbc(True, True, True)'