aiida_vasp.common.dryrun#

Module to provide dryrun functionality.

Module Contents#

Classes#

JobScheme

A class representing the scheme of the jobs.

Functions#

factors

Return all factors of a number in descending order, including the number itself.

dryrun_vasp

Perform a dryrun for a VASP calculation, return obtained information.

get_jobscheme

Perform a dryrun for the input and work out the best parallelisation strategy.

prepare_inputs

Prepare inputs for VASP calculation.

dryrun_relax_builder

Dry run a relaxation workchain builder.

dryrun_vaspu_builder

Dry run a vaspu.vasp workchain builder.

API#

class aiida_vasp.common.dryrun.JobScheme(n_kpoints: int, n_procs: int, n_nodes: Optional[int] = None, cpus_per_node: Optional[int] = None, npw: Optional[int] = None, nbands: Optional[int] = None, ncore_within_node: bool = True, ncore_strategy: str = 'maximise', wf_size_limit: float = 1000)[source]#

A class representing the scheme of the jobs.

Initialization

Instantiate a JobScheme object.

Parameters:
  • n_kpoints – Number of kpoints.

  • n_procs – Number of processes.

  • n_nodes – Number of nodes.

  • cpus_per_node – Number of CPUs per node.

  • npw – Number of plane waves.

  • nbands – Number of bands.

  • ncore_within_node – If True, limit plane-wave parallelisation to within each node.

  • ncore_strategy – Strategy for optimising NCORE, choose from ‘maximise’ and ‘balance’.

  • wf_size_limit – Limit of the ideal wavefunction size per process in MB.

classmethod from_dryrun(dryrun_outcome: dict, n_procs: int, **kwargs) aiida_vasp.common.dryrun.JobScheme[source]#

Construct from dryrun results.

Parameters:
  • dryrun_outcome – The outcome from a dryrun.

  • n_procs – Number of processes.

  • kwargs – Additional keyword arguments.

Returns:

A JobScheme object

solve_kpar() int[source]#

Solve for the optimum strategy for KPAR.

Returns:

The optimized KPAR value.

property nk_per_group: int#

Number of kpoints per group.

property procs_per_kgroup: int#

Number of processes per kpoint group.

solve_ncore() int[source]#

Solve for NCORE.

Returns:

The optimized NCORE value.

property size_wavefunction: float#

Memory requirement for the wavefunction in MB.

property size_wavefunction_per_proc: float#

Memory requirement for the wavefunction per process.

aiida_vasp.common.dryrun.factors(num: int) list[int][source]#

Return all factors of a number in descending order, including the number itself.

Parameters:

num – The number to factor.

Returns:

A list of factors.

aiida_vasp.common.dryrun.dryrun_vasp(input_dict: dict | aiida.engine.processes.builder.ProcessBuilder, vasp_exe: str = 'vasp_std', timeout: int = 10, work_dir: str | None = None, keep: bool = False) dict[source]#

Perform a dryrun for a VASP calculation, return obtained information.

Parameters:
  • input_dict – The input dictionary/builder for VaspCalculation.

  • vasp_exe – The VASP executable to be used.

  • timeout – Timeout for the underlying VASP process in seconds.

  • work_dir – Working directory, if not supplied, will use a temporary directory.

  • keep – Whether to keep the dryrun output.

Returns:

A dictionary of the dry run results parsed from OUTCAR.

aiida_vasp.common.dryrun.get_jobscheme(input_dict: dict, nprocs: int, vasp_exe: str = 'vasp_std', **kwargs) aiida_vasp.common.dryrun.JobScheme[source]#

Perform a dryrun for the input and work out the best parallelisation strategy.

Parameters:
  • input_dict – Inputs of the VaspCalculation.

  • nprocs – Target number of processes to be used.

  • vasp_exe – The executable of local VASP program to be used.

  • kwargs – Additional keyword arguments to be passed to JobScheme.

Returns:

A JobScheme object.

aiida_vasp.common.dryrun.prepare_inputs(inputs: dict) aiida_vasp.calcs.vasp.VaspCalculation[source]#

Prepare inputs for VASP calculation.

Parameters:

inputs – The inputs to prepare.

Returns:

The prepared inputs.

aiida_vasp.common.dryrun.dryrun_relax_builder(builder: aiida.engine.processes.builder.ProcessBuilder, **kwargs) dict[source]#

Dry run a relaxation workchain builder.

Parameters:
  • builder – The builder to dry run.

  • kwargs – Additional keyword arguments.

Returns:

The results of the dry run.

aiida_vasp.common.dryrun.dryrun_vaspu_builder(builder: aiida.engine.processes.builder.ProcessBuilder, **kwargs) dict[source]#

Dry run a vaspu.vasp workchain builder.

Parameters:
  • builder – The builder to dry run.

  • kwargs – Additional keyword arguments.

Returns:

The results of the dry run.