@@ -19,7 +19,7 @@ FireWorks libraries. Briefly:
19
19
20
20
Running and writing your own workflows are covered in later tutorials. For now, these
21
21
topics will be covered in enough depth to get you set up and to help you know where to
22
- troubleshoot if you are having problems.
22
+ troubleshoot if you're having problems.
23
23
24
24
Note that this installation tutorial is VASP-centric since almost all functionality
25
25
currently in atomate2 pertains to VASP.
@@ -66,7 +66,7 @@ academic computing clusters as well as systems with a MOM-node style architectur
66
66
VASP
67
67
----
68
68
69
- To get access to VASP on supercomputing resources typically requires that you are added
69
+ To get access to VASP on supercomputing resources typically requires that you're added
70
70
to a user group on the system you work on after your license is verified. Ensure that
71
71
you have access to the VASP executable and that it is functional before starting this
72
72
tutorial.
@@ -78,34 +78,30 @@ MongoDB_ is a NoSQL database that stores each database entry as a document, whic
78
78
represented in the JSON format (the formatting is similar to a dictionary in Python).
79
79
Atomate2 uses MongoDB to:
80
80
81
- * to create database of calculation results.
82
- * store the workflows that you want to run as well as their state details (through
81
+ * Create a database of calculation results.
82
+ * Store the workflows that you want to run as well as their state details (through
83
83
FireWorks - optional).
84
84
85
- MongoDB must be running and available to accept connections whenever you are running
85
+ MongoDB must be running and available to accept connections whenever you're running
86
86
workflows. Thus, it is strongly recommended that you have a server to run MongoDB or
87
87
(simpler) use a hosting service. Your options are:
88
88
89
- * use a commercial service to host your MongoDB instance. These are typically the
89
+ - Use a commercial service to host your MongoDB instance. These are typically the
90
90
easiest to use and offer high quality service but require payment for larger
91
- databases. `MongoDB Atlas <https://www.mongodb.com/cloud/atlas >`_ offers free 500 MB
92
- which is certainly enough to get started for small to medium size projects, and it is
93
- easy to upgrade or migrate your database if you do exceed the free allocation.
94
- * contact your supercomputing center to see if they offer MongoDB hosting (e.g., NERSC
95
- has this, Google "request NERSC MongoDB database")
96
- * self -host a MongoDB server
97
-
98
- If you are just starting, we suggest the first (with a free plan) or second option
91
+ databases. `MongoDB Atlas <https://www.mongodb.com/cloud/atlas >`_ offers a free 500 MB
92
+ server which is certainly enough to get started for small to medium size projects, and
93
+ it is easy to upgrade or migrate your database if you exceed the free allocation.
94
+ - Contact your supercomputing center to see if they offer MongoDB hosting (e.g., NERSC
95
+ has this, Google "request NERSC MongoDB database").
96
+ - Self -host a MongoDB server.
97
+
98
+ If you're just starting, we suggest the first (with a free plan) or second option
99
99
(if available to you). The third option will require you to open up network settings to
100
100
accept outside connections properly which can sometimes be tricky.
101
101
102
- Next, create a new database and set up two new username/password combinations:
103
-
104
- - an admin user
105
- - a read-only user
106
-
107
- Keep a record of your credentials - we will configure jobflow to connect to them in a
108
- later step. Also make sure you note down the hostname and port for the MongoDB instance.
102
+ Next, create a new database and set up an account with admin access. Keep a record of
103
+ your credentials - we will configure jobflow to connect to them in a later step. Also
104
+ make sure you note down the hostname and port for the MongoDB instance.
109
105
110
106
.. note ::
111
107
@@ -116,15 +112,15 @@ later step. Also make sure you note down the hostname and port for the MongoDB i
116
112
centers (e.g., LLNL, PNNL, ARCHER) will run into issues. If you run into connection
117
113
issues later in this tutorial, some options are:
118
114
119
- * contact your computing center to review their security policy to allow connections
120
- from your MongoDB server (best resolution)
121
- * host your Mongo database on a machine that you are able to securely connect to,
122
- e.g. on the supercomputing network itself (ask a system administrator for help)
123
- * use a proxy service to forward connections from the MongoDB --> login node -->
115
+ - Contact your computing center to review their security policy to allow connections
116
+ from your MongoDB server (best resolution).
117
+ - Host your Mongo database on a machine that you're able to securely connect to,
118
+ e.g. on the supercomputing network itself (ask a system administrator for help).
119
+ - Use a proxy service to forward connections from the MongoDB --> login node -->
124
120
compute node (you might try, for example, `the mongo-proxy tool
125
121
<https://github.com/bakks/mongo-proxy> `_).
126
- * set up an ssh tunnel to forward connections from allowed machines (the tunnel must
127
- be kept alive at all times you are running workflows)
122
+ - Set up an ssh tunnel to forward connections from allowed machines (the tunnel must
123
+ be kept alive at all times you're running workflows).
128
124
129
125
130
126
.. _MongoDB : https://docs.mongodb.com/manual/
@@ -234,7 +230,7 @@ jobflow.yaml
234
230
------------
235
231
236
232
The ``jobflow.yaml `` file contains the credentials of the MongoDB server that will store
237
- calculation outputs. The ``jobflow.json `` file requires you to enter the basic database
233
+ calculation outputs. The ``jobflow.yaml `` file requires you to enter the basic database
238
234
information as well as what to call the main collection that results are kept in (e.g.
239
235
``ouputs ``). Note that you should replace the whole ``<<PROPERTY>> `` definition with
240
236
your own settings.
@@ -260,6 +256,40 @@ your own settings.
260
256
password : <<PASSWORD>>
261
257
collection_name : outputs_blobs
262
258
259
+ .. note ::
260
+
261
+ If you're using a mongoDB hosted on Atlas (using the free plan linked above) the
262
+ connection format is slightly different. Instead your ``jobflow.yaml `` file should
263
+ contain the following.
264
+
265
+ .. code-block :: yaml
266
+
267
+ JOB_STORE :
268
+ docs_store :
269
+ type : MongoURIStore
270
+ uri : mongodb+srv://<<USERNAME>>:<<PASSWORD>>@<<HOST>>/<<DB_NAME>>?retryWrites=true&w=majority
271
+ collection_name : outputs
272
+ additional_stores :
273
+ data :
274
+ type : GridFSURIStore
275
+ uri : mongodb+srv://<<USERNAME>>:<<PASSWORD>>@<<HOST>>/<<DB_NAME>>?retryWrites=true&w=majority
276
+ collection_name : outputs_blobs
277
+
278
+ The URI key may be different based on the Atlas database you deployed. You can
279
+ see the template for the URI string by clicking on "Databases" (under "Deployment"
280
+ in the left hand menu) then "Connect" then "Connect your application". Select
281
+ Python as the driver and 3.12 as the version. The connection string should now be
282
+ displayed in the box.
283
+
284
+ Note that the username and password are not your login account details for Atlas.
285
+ Instead you must add a new database user by selecting "Database Access" (under
286
+ "Security" in the left hand menu) and then "Add a new database user".
287
+
288
+ Secondly, Atlas only allows connections from known IP addresses. You must therefore
289
+ add the IP address of your cluster (and any other computers you'll be connecting
290
+ from) by clicking "Network Access" (under "Security" in the left hand menu) and then
291
+ "Add IP address".
292
+
263
293
Atomate2 uses two database collections, one for small documents (such as elastic
264
294
tensors, structures, and energies) called the ``docs `` store and another for large
265
295
documents such as band structures and density of states called the ``data `` store.
@@ -313,7 +343,7 @@ where ``<<INSTALL_DIR>>`` is your installation directory.
313
343
Configure pymatgen
314
344
==================
315
345
316
- If you are planning to run VASP, the last configuration step is to configure pymatgen to
346
+ If you're planning to run VASP, the last configuration step is to configure pymatgen to
317
347
(required) find the pseudopotentials for VASP and (optional) set up your API key from
318
348
the `Materials Project `_.
319
349
@@ -383,7 +413,7 @@ or work directory) and create a file called ``relax.py`` containing:
383
413
relax_job = RelaxMaker().make(si_structure)
384
414
385
415
# run the job
386
- run_locally(relax_job)
416
+ run_locally(relax_job, create_folders = True )
387
417
388
418
The ``run_locally `` function is a jobflow command that will execute the workflow on
389
419
the current computing resource.
@@ -437,7 +467,7 @@ output.
437
467
438
468
# query the job store
439
469
result = store.query_one(
440
- query = {" output.formula_pretty" : " Si" }, properties = [" output.output.energy_per_atom" ]
470
+ {" output.formula_pretty" : " Si" }, properties = [" output.output.energy_per_atom" ]
441
471
)
442
472
print (result)
443
473
0 commit comments