generate_submission

Module to prepare job submission scripts

Functions

generate_submission_files(which_calc, ...)

Generate submission files based on the calculation type, parallel command, number of processors, and a dictionary of commands. Parameters: - which_calc (str): The type of calculation. Valid options include 'qe', 'epw', 'wannier', and 'vasp'. - parallel_command (str): The parallel command to be used for execution, e.g., 'mpirun'. - nproc (str): The number of processors to be used. - command_list (dict): A dictionary containing command information for each calculation type. Keys are command names, and values are tuples containing the executable command, input file, and output file.

main()

Load parameters from a JSON file, generate submission files based on the specified calculation type, and create a script containing the submission commands.

generate_submission.generate_submission_files(which_calc, parallel_command, nproc, command_list)[source]

Generate submission files based on the calculation type, parallel command, number of processors, and a dictionary of commands. Parameters: - which_calc (str): The type of calculation.

Valid options include ‘qe’, ‘epw’, ‘wannier’, and ‘vasp’.

  • parallel_command (str): The parallel command to be used for execution, e.g., ‘mpirun’.

  • nproc (str): The number of processors to be used.

  • command_list (dict): A dictionary containing command information for each calculation type. Keys are command names, and values are tuples containing the executable command, input file, and output file.

Returns: - submission_files (dict): A dictionary containing generated submission files.

Keys are command names, and values are formatted submission commands ready for execution.

Raises: - ValueError: If an invalid calculation type is provided.

Example: >>> command_list = { … ‘scf’: (‘pw.x’, ‘scf.in’, ‘scf.out’), … ‘nscf’: (‘pw.x’, ‘nscf.in’, ‘nscf.out’) … } >>> submission_files = generate_submission_files(‘qe’, ‘mpirun’, ‘4’, command_list) >>> print(submission_files)

generate_submission.main()[source]

Load parameters from a JSON file, generate submission files based on the specified calculation type, and create a script containing the submission commands.

Reads parameters from ‘config.json’ and defines command dictionaries for different calculation types. Generates submission files based on the provided calculation type and prints the submission commands. Creates a script containing the submission commands named ‘run-<calculation_type>.sh’.

Parameters: None

Returns: None