aiida_quantumespresso.calculations.pwimmigrant#

Plugin to immigrate a Quantum Espresso pw.x job that was not run using AiiDa.

Module Contents#

Classes#

PwimmigrantCalculation

Create a PwCalculation object that can be used to import old jobs.

class aiida_quantumespresso.calculations.pwimmigrant.PwimmigrantCalculation(*args, **kwargs)[source]#

Bases: aiida_quantumespresso.calculations.pw.PwCalculation

Create a PwCalculation object that can be used to import old jobs.

This is a sublass of aiida_quantumespresso.calculations.PwCalculation with slight modifications to some of the class variables and additional methods that

  1. parse the job’s input file to create the calculation’s input nodes that would exist if the calculation were submitted using AiiDa,

  2. bypass the functions of the daemon, and prepare the node’s attributes such that all the processes (copying of the files to the repository, results parsing, ect.) can be performed

Note

The keyword arguments of PwCalculation are also available.

Parameters:
  • remote_workdir (str) – Absolute path to the directory where the job was run. The transport of the computer you link ask input to the calculation is the transport that will be used to retrieve the calculation’s files. Therefore, remote_workdir should be the absolute path to the job’s directory on that computer.

  • input_file_name (str) – The file name of the job’s input file.

  • output_file_name (str) – The file name of the job’s output file (i.e. the file containing the stdout of QE).

property _OUTPUT_SUBFOLDER[source]#
property _PREFIX[source]#
property _INPUT_FILE_NAME[source]#
property _OUTPUT_FILE_NAME[source]#
_init_internal_params()[source]#
create_input_nodes(open_transport, input_file_name=None, output_file_name=None, remote_workdir=None)[source]#

Create calculation input nodes based on the job’s files.

Parameters:

open_transport (aiida.transports.plugins.local.LocalTransport or aiida.transports.plugins.ssh.SshTransport) – An open instance of the transport class of the calculation’s computer. See the tutorial for more information.

This method parses the files in the job’s remote working directory to create the input nodes that would exist if the calculation were submitted using AiiDa. These nodes are

  • a 'parameters' Dict node, based on the namelists and their variable-value pairs;

  • a 'kpoints' KpointsData node, based on the K_POINTS card;

  • a 'structure' StructureData node, based on the ATOMIC_POSITIONS and CELL_PARAMETERS cards;

  • one 'pseudo_X' UpfData node for the pseudopotential used for the atomic species with name X, as specified in the ATOMIC_SPECIES card;

  • a 'settings' Dict node, if there are any fixed coordinates, or if the gamma kpoint is used;

and can be retrieved as a dictionary using the get_incoming() method. These input links are cached-links; nothing is stored by this method (including the calculation node itself).

Note

QE stores the calculation’s pseudopotential files in the <outdir>/<prefix>.save/ subfolder of the job’s working directory, where outdir and prefix are QE CONTROL variables (see pw input file description). This method uses these files to either get–if the a node already exists for the pseudo–or create a UpfData node for each pseudopotential.

Keyword arguments

Note

These keyword arguments can also be set when instantiating the class or using the set_ methods (e.g. set_remote_workdir). Offering to set them here simply offers the user an additional place to set their values. Only the values that have not yet been set need to be specified.

Parameters:
  • input_file_name (str) – The file name of the job’s input file.

  • output_file_name (str) – The file name of the job’s output file (i.e. the file containing the stdout of QE).

  • remote_workdir (str) – Absolute path to the directory where the job was run. The transport of the computer you link ask input to the calculation is the transport that will be used to retrieve the calculation’s files. Therefore, remote_workdir should be the absolute path to the job’s directory on that computer.

Raises:
_prepare_for_retrieval(open_transport)[source]#

Prepare the calculation for retrieval by daemon.

Parameters:

open_transport (aiida.transports.plugins.local.LocalTransport or aiida.transports.plugins.ssh.SshTransport) – An open instance of the transport class of the calculation’s computer.

Here, we

  • manually set the files to retrieve

  • store the calculation and all it’s input nodes

  • copy the input file to the calculation’s raw_input_folder in the

  • store the remote_workdir as a RemoteData output node

prepare_for_retrieval_and_parsing(open_transport)[source]#

Tell the daemon that the calculation is computed and ready to be parsed.

Parameters:

open_transport (aiida.transports.plugins.local.LocalTransport or aiida.transports.plugins.ssh.SshTransport) – An open instance of the transport class of the calculation’s computer. See the tutorial for more information.

The next time the daemon updates the status of calculations, it will see this job is in the ‘COMPUTED’ state and will retrieve its output files and parse the results.

If the daemon is not currently running, nothing will happen until it is started again.

This method also stores the calculation and all input nodes. It also copies the original input file to the calculation’s repository folder.

Raises:
set_remote_workdir(remote_workdir)[source]#

Set the job’s remote working directory.

Parameters:

remote_workdir (str) – Absolute path of the job’s remote working directory.

set_output_subfolder(output_subfolder)[source]#

Manually set the job’s outdir variable (e.g. './out/').

Note

The outdir variable is normally set automatically by

  1. looking for the outdir CONTROL namelist variable

  2. looking for the $ESPRESSO_TMPDIR environment variable on the calculation’s computer (using the transport)

  3. using the QE default, the calculation’s remote_workdir

but this method is made available to the user, in the event that they wish to set it manually.

Parameters:

output_subfolder (str) – The job’s outdir variable.

set_prefix(prefix)[source]#

Manually set the job’s prefix variable (e.g. 'pwscf').

Note

The prefix variable is normally set automatically by

  1. looking for the prefix CONTROL namelist variable

  2. using the QE default, 'pwscf'

but this method is made available to the user, in the event that they wish to set it manually.

Parameters:

prefix (str) – The job’s prefix variable.

set_input_file_name(input_file_name)[source]#

Set the file name of the job’s input file (e.g. 'pw.in').

Parameters:

input_file_name (str) – The file name of the job’s input file.

set_output_file_name(output_file_name)[source]#

Set the file name of the job’s output file (e.g. 'pw.out').

Parameters:

output_file_name (str) – The file name of file containing the job’s stdout.