Skip to content

Commit

Permalink
Merge pull request #198 from atztogo/master
Browse files Browse the repository at this point in the history
Update tutorial document at ISSP Univ. Tokyo
  • Loading branch information
atztogo committed Dec 14, 2019
2 parents 6472197 + 1623a61 commit d4ab7ec
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 220 deletions.
21 changes: 11 additions & 10 deletions docs/pages/2019_ISSP_Chiba_Japan/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@
+-----------------+--------------------------------------------------------------------------------+
| Related resources |
+=================+================================================================================+
| Virtual Machine | `Quantum Mobile 19.09.0`_ |
| Virtual Machine | `Quantum Mobile (ISSP special)`_ |
+-----------------+--------------------------------------------------------------------------------+
| python packages | `aiida-core 1.0.0b6`_, `aiida-quantumespresso 3.0.0a5`_, `aiidalab 19.08.0a1`_ |
| python packages | `aiida-core 1.0.1`_, `aiida-quantumespresso 3.0.0a5`_, `aiidalab 19.11.0a2`_ |
+-----------------+--------------------------------------------------------------------------------+
| codes | `Quantum Espresso 6.4.1`_ |
+-----------------+--------------------------------------------------------------------------------+

.. _Quantum Mobile 19.09.0: https://github.com/marvel-nccr/quantum-mobile/releases/tag/19.09.0
.. _aiida-core 1.0.0b6: https://pypi.org/project/aiida-core/1.0.0b6
.. _Quantum Mobile (ISSP special): http://phonondb.mtl.kyoto-u.ac.jp/aiida_tutorial/Quantum_Mobile_ISSP.ova
.. _aiida-core 1.0.1: https://pypi.org/project/aiida-core/1.0.1
.. _aiida-quantumespresso 3.0.0a5: https://pypi.org/project/aiida-quantumespresso/3.0.0a5
.. _aiidalab 19.08.0a1: https://pypi.org/project/aiidalab/19.8.0a1
.. _aiidalab 19.11.0a2: https://pypi.org/project/aiidalab/19.11.0a2
.. _Quantum Espresso 6.4.1: https://github.com/QEF/q-e/releases/tag/qe-6.4.1

These are the hands-on materials from the 2-day AiiDA tutorial
|tutorial_name| from December 19-20, 2019.

Participants of the tutorial use the Quantum Mobile VirtualBox image
linked above or from `this mirror
<http://phonondb.mtl.kyoto-u.ac.jp/quantum_mobile_19.09.0.ova>`_ on
their own computer. The image already contains all the required
software.
Participants of the tutorial use the Quantum Mobile VirtualBox virtual
machine (VM) image linked above on their own computer. The image
already contains all the required software. This VM image can be
imported from the GUI interface of VirtualBox by "File => Import
Appliance" or from the Virtualbox window "[Tools] =>
[Import]".

Getting started
---------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
"metadata": {},
"outputs": [],
"source": [
"generate_query_graph(qb.get_json_compatible_queryhelp(), 'query1.png')\n",
"generate_query_graph(qb.queryhelp, 'query1.png')\n",
"Image(filename='query1.png')"
]
},
Expand Down Expand Up @@ -629,7 +629,7 @@
"source": [
"qb = QueryBuilder()\n",
"# Here I also visualize what's going on:\n",
"generate_query_graph(qb.get_json_compatible_queryhelp(), 'query2.png')\n",
"generate_query_graph(qb.queryhelp, 'query2.png')\n",
"Image(filename='query2.png')"
]
},
Expand Down Expand Up @@ -775,7 +775,7 @@
"qb.append(Group, filters={'label':{'like':'tutorial_%'}}, project='label', tag='group')\n",
"# Visualize:\n",
"print(\"Groups:\", ', '.join([g for g, in qb.all()]))\n",
"generate_query_graph(qb.get_json_compatible_queryhelp(), 'query3.png')\n",
"generate_query_graph(qb.queryhelp, 'query3.png')\n",
"Image(filename='query3.png')"
]
},
Expand All @@ -795,7 +795,7 @@
"# I want every PwCalculation that is a member of the specified groups:\n",
"qb.append(PwCalculation, tag='calculation', with_group=) # Complete the function call with the correct relationship-tag!\n",
"#Visualize\n",
"generate_query_graph(qb.get_json_compatible_queryhelp(), 'query4.png') \n",
"generate_query_graph(qb.queryhelp, 'query4.png') \n",
"Image(filename='query4.png')"
]
},
Expand All @@ -822,7 +822,7 @@
"# Complete the function call with the correct relationship-tag!\n",
"qb.append(StructureData, project=, tag='structure', with_outgoing=)\n",
"# Visualize:\n",
"generate_query_graph(qb.get_json_compatible_queryhelp(), 'query5.png')\n",
"generate_query_graph(qb.queryhelp, 'query5.png')\n",
"Image(filename='query5.png')"
]
},
Expand Down Expand Up @@ -854,7 +854,7 @@
"# Complete the function call with the correct relationship-tag!\n",
"qb.append(Dict, tag='results', project=['attributes.energy_smearing', ...], with_incoming=)\n",
"\n",
"generate_query_graph(qb.get_json_compatible_queryhelp(), 'query6.png') \n",
"generate_query_graph(qb.queryhelp, 'query6.png') \n",
"Image(filename='query6.png')"
]
},
Expand Down
74 changes: 38 additions & 36 deletions docs/pages/2019_ISSP_Chiba_Japan/sections/calculations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ error code near the "Finished" status of the State should be non-zero,
.. code:: bash
$ verdi process list -a -p1
PK Created State Process label Process status
---- --------- ---------------- --------------- ----------------
98 16h ago Finished [115] PwCalculation
PK Created Process label Process State Process status
---- --------- --------------- ---------------- ----------------
2060 3m ago PwCalculation ⏹Finished [300]
...
$ # Anything but [0] after the Finished state signals a failure
Expand All @@ -521,38 +521,38 @@ For any calculation, both successful and failed, you can get a summary by:
.. code:: bash
$ verdi process show <pk_number>
Property Value
------------- ---------------------------------------------------
type CalcJobNode
pk 98
uuid 4c444afd-f6e2-4896-b9ae-8cb8a5ec75c5
label PW test
description My first AiiDA calc with Quantum ESPRESSO on Si
ctime 2019-05-01 15:59:39.180018+00:00
mtime 2019-05-01 16:01:44.870902+00:00
process state Finished
exit status 115
computer [1] localhost
Property Value
----------- --------------------------------------------------------------------------------
type PwCalculation
state Finished [300] Both the stdout and XML output files could not be read or parsed.
pk 2060
uuid cd874e9d-94f7-4fc8-88c5-decdfc031491
label PW test
description My first AiiDA calc with Quantum ESPRESSO on Si
ctime 2019-12-13 06:14:07.374401+00:00
mtime 2019-12-13 06:14:19.775021+00:00
computer [2] localhost
Inputs PK Type
---------- ---- -------------
pseudos
Si 50 UpfData
code 2 Code
kpoints 10 KpointsData
parameters 96 Dict
settings 97 Dict
structure 9 StructureData
Outputs PK Type
------------- ---- ----------
remote_folder 99 RemoteData
retrieved 100 FolderData
Si 2003 UpfData
code 2056 Code
kpoints 2058 KpointsData
parameters 2059 Dict
structure 2057 StructureData
Outputs PK Type
----------------- ---- --------------
output_parameters 2064 Dict
output_trajectory 2063 TrajectoryData
remote_folder 2061 RemoteData
retrieved 2062 FolderData
Log messages
---------------------------------------------
There are 2 log messages for this calculation
Run 'verdi process report 98' to see them
There are 3 log messages for this calculation
Run 'verdi process report 2060' to see them
The last part of the output alerts you to the fact that there
are some log messages waiting for you, if you run
Expand All @@ -564,16 +564,18 @@ key and see if our calculation succeeds:
.. code:: python
parameters_dict = {
"CONTROL": {
"calculation": "scf",
'CONTROL': {
'calculation': 'scf',
'tstress': True,
'tprnfor': True,
},
'SYSTEM': {
'ecutwfc': 30.,
'ecutrho': 200.,
},
"SYSTEM": {
"ecutwfc": 30.,
"ecutrho": 200.,
'ELECTRONS': {
'conv_thr': 1.e-8,
},
"ELECTRONS": {
"conv_thr": 1.e-6,
}
}
builder.parameters = Dict(dict=parameters_dict)
calculation = submit(builder)
Expand Down
81 changes: 6 additions & 75 deletions docs/pages/2019_ISSP_Chiba_Japan/sections/first_taste.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There are a number of helpful resources available to you for getting more inform
Please consider:

* consulting the extensive `AiiDA documentation <https://aiida-core.readthedocs.io/en/latest/>`_
* asking in the `Slack channel of the tutorial <https://aiida-tutorial-india.slack.com>`_
* asking in the `Slack channel of the tutorial <https://aiidatutorial-tck8243.slack.com>`_
* asking your neighbor
* asking a tutor
* opening a new issue on the `tutorial issue tracker <https://github.com/aiidateam/aiida-tutorials/issues>`_
Expand Down Expand Up @@ -136,79 +136,8 @@ A few questions you could answer using these commands (optional)

.. tip::

Use the ``grep`` command to filter the terminal output by keywords, e.g., ``verdi calc job res 175 | grep wall_time``.
Use the ``grep`` command to filter the terminal output by keywords, e.g., ``verdi calcjob res 175 | grep wall_time``.

Moving to a different computer
------------------------------

The Quantum ESPRESSO calculation we just ran, was directly executed on the virtual machine.
This is fine for tests, but production calculations should typically be run on a remote compute cluster.
With AiiDA, moving a calculation from one computer to another means changing one line of code.

For the purposes of this tutorial, you'll run on your neighbor's computer.
Ask your neighbor for the IP address of their VM.
Then, download the :download:`neighbor.yml <include/configuration/neighbor.yml>` setup template, replace the placeholder by the IP address and let AiiDA know about this computer by running:

.. .. literalinclude:: include/configuration/neighbor.yml
.. code:: bash
verdi computer setup --config neighbor.yml
.. note::

If you do not have a partner machine available, for example because you are completing this
tutorial at a later time, simply use "localhost" instead of the IP address.

AiiDA is now aware of the existence of the computer but you'll still need to let AiiDA
know how to connect to it.
AiiDA does this via `SSH <https://en.wikipedia.org/wiki/Secure_Shell>`_ keys.
Your tutorial VM already contains a private SSH key for connecting to the ``compute`` user of your neighbor's machine,
so all that is left is to configure it in AiiDA.

Download the :download:`neighbor-config.yml <include/configuration/neighbor-config.yml>` configuration template and run:

.. .. literalinclude:: include/configuration/neighbor-config.yml
.. code:: bash
verdi computer configure ssh neighbor --config neighbor-config.yml --non-interactive
.. note:: Both ``verdi computer setup`` and ``verdi computer configure`` can be used interactively without
configuration files, which are provided here just to avoid typing errors.

AiiDA should now have access to your neighbor's computer. Let's quickly test this:

.. code:: bash
verdi computer test neighbor
Finally, let AiiDA know about the **code** we are going to use.
We've again prepared a template that looks as follows:

.. literalinclude:: include/configuration/qe.yml

Download the :download:`qe.yml <include/configuration/qe.yml>` code template and run:

.. code:: bash
verdi code setup --config qe.yml
verdi code list # note the label of the new code you just set up!
Now modify the code label in your ``demo_calcjob.py`` script to the label of your new code and simply run another calculation using ``verdi run demo_calcjob.py``.

To see what is going on, AiiDA provides a command that lets you jump to the folder of the directory of the calculation on the remote computer:

.. code:: bash
verdi process list --all # get PK of new calculation
verdi calcjob gotocomputer <PK>
Have a look around.
* Do you recognize the different files?
* Have a look at the submission script ``_aiidasubmit.sh``.
Compare it to the submission script of your previous calculation.
What are the differences?

From calculations to workflows
------------------------------
Expand Down Expand Up @@ -268,11 +197,13 @@ Start the AiiDA REST API:
verdi restapi
and open the |provenance browser|.
and open the |provenance browser|. If you can't see any useful
information, please ask to tutors, because restapi v4 may have some
issue on the day of this tutorial.

.. |provenance browser| raw:: html

<a href="https://www.materialscloud.org/explore/ownrestapi?base_url=http://127.0.0.1:5000/api/v3" target="_blank">Materials Cloud provenance browser</a>
<a href="https://www.materialscloud.org/explore/ownrestapi?base_url=http://127.0.0.1:5000/api/v4" target="_blank">Materials Cloud provenance browser</a>

.. note::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ transport: local
scheduler: "direct"
work_dir: "/home/max/.aiida_run"
mpirun_command: "mpirun -np {tot_num_mpiprocs}"
mpiprocs_per_machine: "2"
mpiprocs_per_machine: "1"
shebang: "#!/bin/bash"
prepend_text: " "
append_text: " "
append_text: " "
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d4ab7ec

Please sign in to comment.