Skip to content

Commit

Permalink
Merge pull request #33 from MolSSI/docs
Browse files Browse the repository at this point in the history
Deep modifications to adopt root users with a few new packages added
  • Loading branch information
molssihub committed Jul 11, 2023
2 parents f90dc63 + f92b35c commit ef389bb
Show file tree
Hide file tree
Showing 36 changed files with 621 additions and 242 deletions.
10 changes: 2 additions & 8 deletions docs/compchem/ase_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ paste it into your terminal and edit it to look like the following command line

.. code-block:: bash
docker run --rm -w /home/molssi/temp -v .:/home/molssi/temp molssi/ase322-mamba141:latest /bin/bash -c "python test.inp"
docker run --rm -w /home -v $PWD:/home molssi/ase322-mamba141:latest /bin/bash -c "python test.inp"
then press Enter.

Expand All @@ -74,12 +74,6 @@ then press Enter.
from the host system to the running container by default. For further details see the Apptainer
`documentation <https://apptainer.org/docs/user/latest/quick_start.html#working-with-files>`_.

.. caution::

Ignore (usually many) wanings that you might get the first time a SIF file is being created.
This is because of Apptainer's `fakeroot <https://apptainer.org/docs/user/1.1/fakeroot.html>`_
feature which allows an unprivileged user to run containers as root by default.

If nothing goes wrong, you should see the following lines in your terminal

.. code-block:: bash
Expand All @@ -95,7 +89,7 @@ If nothing goes wrong, you should see the following lines in your terminal

.. code-block:: bash
docker run --rm -w /home/molssi/temp -v .:/home/molssi/temp molssi/ase322-mamba141:latest /bin/bash -c "python test.inp >> test.out"
docker run --rm -w /home -v $PWD:/home molssi/ase322-mamba141:latest /bin/bash -c "python test.inp >> test.out"
or

Expand Down
7 changes: 5 additions & 2 deletions docs/compchem/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ construct and run containerized computational chemistry software.

ase322-mamba141
ase_example
lammps-mamba141
lammps_example
mendeleev045-mamba141
mopac220-mamba141
mopac_example
psi4v180-mamba141-ase322
psi4-ase_example
psi4v180-mamba141
psi4_example
psi4v180-mamba141-ase322
psi4-ase_example
pyscf221-mamba141
pyscf_example
76 changes: 76 additions & 0 deletions docs/compchem/lammps-mamba141.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.. _lammps_mamba141:

*********************************************************
{{ lammps_mamba141.hub_specifications[0]["Source"].split("/")[-1] }}
*********************************************************

{% set title = lammps_mamba141.get("name") %}

{{title}}
=========================================================

{% block content %}
{{ lammps_mamba141.description }}
{% endblock content %}

Source Specifications
=====================

{% block specifications %}
{% for dc in lammps_mamba141.source_specifications %}
{% for key, value in dc.items() %}
* **{{ key }}**: {{ value }}
{% endfor %}
{% endfor %}
{% endblock specifications %}

MolSSI Container Hub Specifications
===================================

{% block hub_specifications %}
{% for dc in lammps_mamba141.hub_specifications %}
{% for key, value in dc.items() %}
* **{{ key }}**: {{ value }}
{% endfor %}
{% endfor %}
{% endblock hub_specifications %}

* **Image pull command**:

.. code-block:: bash
{{ lammps_mamba141.docker_pull_command }}
* **Container run command**:

.. code-block:: bash
{{ lammps_mamba141.docker_run_command }}
{% block note %}
{% if lammps_mamba141.note != "" %}
.. note::

{{ lammps_mamba141.note }}
{% endif %}
{% endblock note %}

Image Specifications
====================

{% block image_specifications %}
{% for dc in lammps_mamba141.image_specifications %}
{% for key, value in dc.items() %}
{% if dc[key] is string or dc[key] == "" %}
* **{{ key }}**: {{ value }}
{% else %}
* **{{ key }}**:
{% for key2 in dc[key] %}
{% for key3, val3 in key2.items() %}
+ *{{ key3 }}*: {{ val3 }}
{% endfor %}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
{% endblock image_specifications %}
114 changes: 114 additions & 0 deletions docs/compchem/lammps_example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.. _lammps_example:

***************
LAMMPS: Example
***************

Here, we demonstrate the non-interactive usage of the LAMMPS image recipe.

Running LAMMPS Non-interactively
================================

First, let's create a temporary folder, ``temp`` in your **home** directory
and ``cd`` to it

.. code-block:: bash
mkdir ~/temp && cd ~/temp
Use your favorite text editor to create a new input file. Let's call it **in.lj**
and copy-paste the following code block into it and then, save it.

.. code-block:: python
# 1) Initialization
units lj
dimension 3
atom_style atomic
pair_style lj/cut 2.5
boundary p p p
# 2) System definition
region simulation_box block -20 20 -20 20 -20 20
create_box 2 simulation_box
create_atoms 1 random 1500 341341 simulation_box
create_atoms 2 random 100 127569 simulation_box
# 3) Simulation settings
mass 1 1
mass 2 1
pair_coeff 1 1 1.0 1.0
pair_coeff 2 2 0.5 3.0
# 4) Visualization
thermo 10
# 5) Run
minimize 1.0e-4 1.0e-6 1000 10000
This input file is borrowed from LAMMPS Tutorial
`page <https://lammpstutorials.github.io/sphinx/build/html/tutorials/lennardjones.html#the-input-script>`_
and intends to run a molecular dynamics simulation of a Lennard-Jones
binary fluid consisting of neutral dots with Langevin thermostat within the NVT ensemble.

At this stage, the content of your directory should look like the following

.. code-block:: bash
temp
└── in.lj
Let's copy the docker run command from the `catalog <https://molssi.github.io/molssi-hub/compchem/lammps-mamba141.html>`_,
paste it into a terminal and edit it to look like the following command line

.. code-block:: bash
docker run --rm -w /home -v $(pwd):/home molssi/lammps-mamba141:latest /bin/bash -c "lmp_serial -in in.lj"
then press Enter. If nothing goes wrong, you should see a long list of lines ending in

.. code-block:: bash
Nlocal: 1600 ave 1600 max 1600 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 756 ave 756 max 756 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 2178 ave 2178 max 2178 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 2178
Ave neighs/atom = 1.36125
Neighbor list builds = 141
Dangerous builds = 1
Total wall time: 0:00:00
.. note::

The same Docker image recipe can also be used with Apptainer (Singularity) to
obtain the same result via the following command

.. code-block:: bash
apptainer exec docker://molssi/lammps-mamba141:latest lmp_serial -in in.lj
Note that Apptainer binds ``/home/$USER``, ``/tmp`` and current working directory (``$PWD``)
from the host system to the running container by default. For further details see the Apptainer
`documentation <https://apptainer.org/docs/user/latest/quick_start.html#working-with-files>`_.

By default, LAMMPS generates a **log.lammps** file with the auto-generated output upon finishing
the job execution.

.. note::

You can store the generated output in a separate output file by passing the ``-l <output_name>``
to the execution command as follows

.. code-block:: bash
docker run --rm -w /home -v $(pwd):/home molssi/lammps-mamba141:latest /bin/bash -c /bin/bash -c "lmp_serial -in in.lj -l log.out"
or

.. code-block:: bash
apptainer exec docker://molssi/lammps-mamba141:latest lmp_serial -in in.lj -l log.out
76 changes: 76 additions & 0 deletions docs/compchem/mendeleev045-mamba141.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.. _mendeleev045_mamba141:

*********************************************************
{{ mendeleev045_mamba141.hub_specifications[0]["Source"].split("/")[-1] }}
*********************************************************

{% set title = mendeleev045_mamba141.get("name") %}

{{title}}
=========================================================

{% block content %}
{{ mendeleev045_mamba141.description }}
{% endblock content %}

Source Specifications
=====================

{% block specifications %}
{% for dc in mendeleev045_mamba141.source_specifications %}
{% for key, value in dc.items() %}
* **{{ key }}**: {{ value }}
{% endfor %}
{% endfor %}
{% endblock specifications %}

MolSSI Container Hub Specifications
===================================

{% block hub_specifications %}
{% for dc in mendeleev045_mamba141.hub_specifications %}
{% for key, value in dc.items() %}
* **{{ key }}**: {{ value }}
{% endfor %}
{% endfor %}
{% endblock hub_specifications %}

* **Image pull command**:

.. code-block:: bash
{{ mendeleev045_mamba141.docker_pull_command }}
* **Container run command**:

.. code-block:: bash
{{ mendeleev045_mamba141.docker_run_command }}
{% block note %}
{% if mendeleev045_mamba141.note != "" %}
.. note::

{{ mendeleev045_mamba141.note }}
{% endif %}
{% endblock note %}

Image Specifications
====================

{% block image_specifications %}
{% for dc in mendeleev045_mamba141.image_specifications %}
{% for key, value in dc.items() %}
{% if dc[key] is string or dc[key] == "" %}
* **{{ key }}**: {{ value }}
{% else %}
* **{{ key }}**:
{% for key2 in dc[key] %}
{% for key3, val3 in key2.items() %}
+ *{{ key3 }}*: {{ val3 }}
{% endfor %}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
{% endblock image_specifications %}
40 changes: 16 additions & 24 deletions docs/compchem/mopac_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,9 @@ paste it into your terminal and edit it to look like the following command line

.. code-block:: bash
docker run --rm -w /home/molssi/temp -v $(pwd):/home/molssi/temp molssi/mopac220-mamba141:latest /bin/bash -c "mopac test.mop test.out"
docker run --rm -w /home -v $PWD:/home molssi/mopac220-mamba141:latest /bin/bash -c "mopac test.mop test.out"
then press Enter.

.. note::

The same Docker image recipe can also be used with Apptainer (Singularity) to
obtain the same result via the following command

.. code-block:: bash
apptainer exec docker://molssi/mopac220-mamba141:latest mopac test.mop test.out
Note that Apptainer binds ``/home/$USER``, ``/tmp`` and current working directory (``$PWD``)
from the host system to the running container by default. For further details see the Apptainer
`documentation <https://apptainer.org/docs/user/latest/quick_start.html#working-with-files>`_.

.. caution::

Ignore (usually many) wanings that you might get the first time a SIF file is being created.
This is because of Apptainer's `fakeroot <https://apptainer.org/docs/user/1.1/fakeroot.html>`_
feature which allows an unprivileged user to run containers as root by default.

If nothing goes wrong, you should see the following lines in your terminal
then press Enter. If nothing goes wrong, you should see the following lines in your terminal

.. code-block:: bash
Expand All @@ -104,4 +83,17 @@ Your directory should now have the following structure

.. code-block:: bash
* JOB ENDED NORMALLY *
* JOB ENDED NORMALLY *
.. note::

The same Docker image recipe can also be used with Apptainer (Singularity) to
obtain the same result via the following command

.. code-block:: bash
apptainer exec docker://molssi/mopac220-mamba141:latest mopac test.mop test.out
Note that Apptainer binds ``/home/$USER``, ``/tmp`` and current working directory (``$PWD``)
from the host system to the running container by default. For further details see the Apptainer
`documentation <https://apptainer.org/docs/user/latest/quick_start.html#working-with-files>`_.
Loading

0 comments on commit ef389bb

Please sign in to comment.