def set_up_g0w0(root_path: str, q_grid: list): species = ['zr', 'o'] l_max = {'zr': 3, 'o': 2} q_str = "".join(str(q) for q in q_grid) # GW input file gw_input_string = set_gw_input_string(A1_gs_input, GWInput(taskname="g0w0", nempty=2000, ngridq=q_grid, skipgnd=False, n_omega=32) ) run_settings = {'222': {'nodes': 4, 'time': [0, 24, 0, 0]}, '444': {'nodes': 10, 'time': [0, 64, 0, 0]}, '666': {'nodes': 12, 'time': [0, 100, 0, 0]} } # Slurm script settings env_vars = OrderedDict([('EXE', '/users/sol/abuccheri/exciting/bin/excitingmpismp'), ('OUT', 'terminal.out') ]) module_envs = ['intel/2019'] slurm_directives = slurm.set_slurm_directives(time=run_settings[q_str]['time'], partition='all', exclusive=True, nodes=run_settings[q_str]['nodes'], ntasks_per_node=2, cpus_per_task=18, hint='nomultithread') # Job directory job_dir = root + '/' + q_str # Write input, basis files and slurm file print('Creating directory, with input.xml, run.sh and optimised basis:', job_dir) copy_tree(root_path + '/groundstate', job_dir) # Copy input.xml with GW settings write_file(job_dir + "/input.xml", gw_input_string) # New Slurm script slurm_directives['job-name'] = "gw_A1_" + q_str write_file(job_dir + '/run.sh', slurm.set_slurm_script(slurm_directives, env_vars, module_envs)) # Optimised bases write_file(job_dir + '/Zr.xml', zr_basis) write_file(job_dir + '/O.xml', o_basis)
def write_input_file_with_gw_settings(root_path:str, gs_input:str, gw_input:GWInput) -> str: """ Generate GW path, create a GW input file and write it :param root_path: :param gs_input: :param gw_input: :return: """ q_str = '' for q in gw_input.ngridq: q_str += str(q) gw_root = root_path + "/gw_q" + q_str + "_omeg" + str(gw_input.nomeg) + "_nempty"+str(gw_input.nempty) Path(gw_root).mkdir(parents=True, exist_ok=True) gw_input_string = set_gw_input_string(A1_gs_input, gw_input) write_file(gw_root + "/input.xml", gw_input_string) return gw_root
def write_input_file_with_gw_settings(root_path: str, gs_input: str, gw_input: GWInput) -> str: """ Generate GW path, create a GW input file and write it :param str root_path: Path to the calculation directory :param str gs_input: ground state input, used as the base for the GW input :param GWInput gw_input: GW calculation input settings :param str gw_template: GW input options template :return: str gw_root: Directory for GW calculations """ q_str = ''.join(str(q) for q in gw_input.ngridq) gw_root = root_path + "/gw_q" + q_str + "_omeg" + str( gw_input.nomeg) + "_nempty" + str(gw_input.nempty) Path(gw_root).mkdir(parents=True, exist_ok=True) gw_input_string = set_gw_input_string(gs_input, gw_input, gw_string_template) write_file(gw_root + "/input.xml", gw_input_string) return gw_root