Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/aiidateam/aiida-core into d…
Browse files Browse the repository at this point in the history
…ocs/5456/require-data-entry-point
  • Loading branch information
AhmedBasem20 committed Mar 3, 2023
2 parents 7402d4f + 82484f9 commit be9fe3e
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions docs/source/howto/run_codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,10 @@ The type of code is specified as the first argument and the rest of the informat

.. tab-item:: Installed

The following example shows how to create an installed code for the ``bash`` binary on the ``localhost`` computer:

.. code-block:: console
The following example shows how to create an installed code for the ``bash`` binary on the ``localhost`` computer:
verdi code create core.code.installed \
--label installed-code \
Expand Down Expand Up @@ -309,7 +310,7 @@ At the end, you receive a confirmation, with the *PK* and the *UUID* of your new
.. tip::

The ``verdi code create`` command performs minimal checks in order to keep it performant and not rely on an internet connection.
If you want additional checks to verify the code is properly configured and usable, run the `verdi code test` command.
If you want additional checks to verify the code is properly configured and usable, run the ``verdi code test`` command.
For installed codes for example, this will check whether the associated computer can be connected to and whether the specified executable exists.
Look at the command help to see what other checks may be run.

Expand Down Expand Up @@ -346,6 +347,23 @@ At the end, you receive a confirmation, with the *PK* and the *UUID* of your new
Note: remove the ``--`` prefix and replace dashes (``-``) within the keys with an underscore ( ``_`` ).


.. note::

It is possible to run codes that are provided by a `Conda environment <https://docs.conda.io/en/latest/>`_.
The associated ``Computer`` should be configured to create a submission script that uses a login shell by setting the ``shebang`` attribute to ``#!/bin/bash -l``.
The ``-l`` flag in bash enforces the script to be executed using a login shell, without which the ``conda activate`` command will fail.

The code configuration YAML would look something like the following:

.. code-block:: yaml
filepath_executable: 'executable-name'
prepend_text: conda activate environment-name
Note that the configuration is not complete but only shows the relevant lines.


Managing codes
--------------

Expand Down Expand Up @@ -431,6 +449,10 @@ After :ref:`setting up your computer <how-to:run-codes:computer>` and :ref:`sett
Of course, the code label and builder inputs need to be adapted to your code and calculation.

.. note::

See also the :ref:`complete list of metadata<topics:calculations:usage:calcjobs:options>` you can pass to a calculation.

* Submit your calculation to the AiiDA daemon:

.. code-block:: bash
Expand Down

0 comments on commit be9fe3e

Please sign in to comment.