Skip to content

Commit

Permalink
Update all snb-xxx functions to auto detect if running in a defect …
Browse files Browse the repository at this point in the history
…folder, or top-level folder (like in `snb-groundstate`), and update tests
  • Loading branch information
kavanase committed Sep 24, 2024
1 parent 9b5d8ec commit 123cb4c
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 716 deletions.
30 changes: 9 additions & 21 deletions docs/Analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@ Where ``defects_folder`` is the path to the top level directory containing the d
different from the current directory.

Instead of a single defect, we can parse the results for **all** defects present
in a given/current directory using the ``-a``/``--all`` flag:

.. code:: bash
$ snb-parse -a
This generates a ``yaml`` file for each defect, mapping each distortion to the
final energy of the relaxed structures (in eV). These files are saved to the
corresponding defect directory (e.g. ``defects_folder/v_Cd_0/v_Cd_0.yaml``).
in a given/current directory by running ``snb-parse`` from the top-level directory
containing our defect folders. This generates a ``yaml`` file for each defect,
mapping each distortion to the final energy of the relaxed structures (in eV).
These files are saved to the corresponding defect directory
(e.g. ``defects_folder/v_Cd_0/v_Cd_0.yaml``).

.. code:: yaml
Expand Down Expand Up @@ -63,12 +59,8 @@ was used (if not :code:`VASP`) and which reference structure to use (default = `
$ snb-analyse --defect v_Cd_0 --code FHI-aims --path defects_folder --ref_struct -0.4 --verbose
Again if we want to analyse the results for **all** defects present in a given/current directory, we can use the
``-a``/``--all`` flag:

.. code:: bash
$ snb-analyse -a
Again if we want to analyse the results for **all** defects present in a given/current directory,
we can just run ``snb-analyse`` from the top-level directory containing the defect folders.

.. NOTE::
Further analysis tools are provided through the python API. These are documented in
Expand Down Expand Up @@ -116,12 +108,8 @@ was used (if not :code:`VASP`) and other options (what ``metric`` to use for col
$ snb-plot --defect v_Cd_0 --code FHI-aims --path defects_folder --colorbar -0.4 --metric disp --units meV --verbose
Again if we want to plot the results for **all** defects present in a given/current directory, we can use the
``-a``/``--all`` flag:

.. code:: bash
$ snb-plot -a
Again if we want to plot the results for **all** defects present in a given/current directory, we can
just run ``snb-plot`` from the top-level directory containing the defect folders.

.. TIP::
See ``snb-plot -h`` or `the CLI docs <https://shakenbreak.readthedocs.io/en/latest/shakenbreak.cli.html#snb-plot>`_
Expand Down
19 changes: 8 additions & 11 deletions docs/Generation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,16 @@ Submitting the geometry optimisations
=======================================

Once the input files have been generated, we can submit the geometry optimisations
for a single or all defects using the ``snb-run`` command.
To submit all defects present in the current directory:
for a single or all defects using the ``snb-run`` command:

.. code:: bash
$ snb-run -a
$ snb-run
If ``snb-run`` is run in the top-level directory (i.e. the directory containing the defect folders),
it will loop through all defect folders present and attempt to submit the distortion calculations for
each. Alternatively, it can be run within a single defect folder to just submit the calculations for
that defect.

This assumes the ``SGE`` queuing system (i.e. ``qsub`` = job submission command) for the HPC and a job script name of
``job`` by default, but again can be controlled with the ``--submit-command`` and ``--job-script`` flags
Expand All @@ -212,14 +216,7 @@ script file name of ``my_job_script.sh``, we would use:

.. code:: bash
$ snb-run --submit-command sbatch --job-script my_job_script.sh --all
To submit a single defect, we can simply run the command :code:`snb-run` within the defect folder:

.. code:: bash
$ snb-run
$ snb-run --submit-command sbatch --job-script my_job_script.sh
``snb-run`` can be used to submit the initial geometry optimisation calculations, as well as automatically continuing
and resubmitting calculations that have not yet converged (and handle calculations which have failed) as discussed in
Expand Down
Loading

0 comments on commit 123cb4c

Please sign in to comment.