def __init__(self, structure, pseudos, kppa=1000, ecut=None, pawecutdg=None, accuracy="normal", spin_mode="polarized", smearing="fermi_dirac:0.1 eV", charge=0.0, scf_algorithm=None, autoparal=False, folder=None, **extra_abivars): """ Args: """ abiinput = ion_ioncell_relax_input(structure=structure, pseudos=pseudos, kppa=kppa, ecut=ecut, pawecutdg=pawecutdg, accuracy=accuracy, spin_mode=spin_mode, smearing=smearing, charge=charge, scf_algorithm=scf_algorithm) abiinput.set_vars(**extra_abivars) abitask = RelaxTask(StrategyWithInput(abiinput.split_datasets()[0])) self.task = RelaxFWTask(abitask) spec = {} if folder: spec['_launch_dir'] = os.path.join(folder, 'atomic_relax') fw = Firework(self.task, spec=spec) if autoparal: autoparal_fw = self.create_autoparal_fw(self.task, spec['_launch_dir']) self.wf = Workflow([autoparal_fw, fw], {autoparal_fw: [fw]}) else: self.wf = Workflow([fw])
def __init__(self, structure, pseudos, kppa=1000, ecut=None, pawecutdg=None, accuracy="normal", spin_mode="polarized", smearing="fermi_dirac:0.1 eV", charge=0.0, scf_algorithm=None, autoparal=False, folder=None, aim_dilatmx=1.01, **extra_abivars): """ Args: """ abiinput = ion_ioncell_relax_input(structure=structure, pseudos=pseudos, kppa=kppa, ecut=ecut, pawecutdg=pawecutdg, accuracy=accuracy, spin_mode=spin_mode, smearing=smearing, charge=charge, scf_algorithm=scf_algorithm) abiinput.set_vars(**extra_abivars) ion_input, ioncell_input = abiinput.split_datasets() abi_ion_task = RelaxTask(StrategyWithInput(ion_input)) # Create the ionic relaxation fw self.ion_task = RelaxFWTask(abi_ion_task, is_autoparal=autoparal) spec = {} if folder: spec['_launch_dir'] = os.path.join(folder, 'atomic_relax') if autoparal: spec.update(self.autoparal_spec) ion_fw = Firework(self.ion_task, spec=spec) abi_ioncell_task = RelaxTask(StrategyWithInput(ioncell_input)) # Create the ionic+cell relaxation fw self.ioncell_task = RelaxFWTask(abi_ioncell_task, deps={id(self.ion_task): "structure"}, is_autoparal=autoparal) spec = {'create_file': 'final'} if folder: spec['_launch_dir'] = os.path.join(folder, 'atomic_and_cell_relax') if autoparal: spec.update(self.autoparal_spec) ioncell_fw = Firework(self.ioncell_task, spec=spec) # # Create the workflow # if autoparal: # autoparal_fw = self.create_autoparal_fw(self.ion_task, ion_fw.spec['_launch_dir']) # self.wf = Workflow([autoparal_fw, ion_fw, ioncell_fw], # {autoparal_fw: [ion_fw], ion_fw: [ioncell_fw]}) # else: self.wf = Workflow([ion_fw, ioncell_fw], {ion_fw: [ioncell_fw]})