How to run atomate in offline Mode?

147 views
Skip to first unread message

zhangz...@gmail.com

unread,
Jan 28, 2018, 10:43:15 AM1/28/18
to atomate
I am trying to run atomate in offline mode, but it seems that atomate cannot run.

Anubhav Jain

unread,
Jan 28, 2018, 2:26:41 PM1/28/18
to zhangz...@gmail.com, atomate
You will need to provide much more detail:

* How did you install atomate?
* What computing resource are you trying to run on?
* What do your configuration files look like?
* What commands are you running?
* What error messages do you get?

On Sun, Jan 28, 2018 at 7:43 AM, <zhangz...@gmail.com> wrote:
I am trying to run atomate in offline mode, but it seems that atomate cannot run.

--
You received this message because you are subscribed to the Google Groups "atomate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atomate+unsubscribe@googlegroups.com.
To post to this group, send email to ato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/atomate/9e0e6e2e-f687-4c82-8f6e-1935d80fbb87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best,
Anubhav

zeying zhang

unread,
Jan 28, 2018, 3:29:08 PM1/28/18
to Anubhav Jain, atomate
Thank you for your reply, sorry my question was not detailed enough, I use pip install atomate --user to install atomate,

Here is my workflow:

from pymatgen import Structure
from fireworks import LaunchPad
from atomate.vasp.workflows.presets.core import wf_bandstructure
struct = Structure.from_file('POSCAR')  
wf = wf_bandstructure(struct)
lpad = LaunchPad.auto_load()
lpad.add_wf(wf)


and my rocket_launch in my_qadapter.yaml is:
rocket_launch: rlaunch -c  /home/zz58wulu/atomate/config  singleshot --offline

when I was trying to use qlaunch -r rapidfire to submit the job, the vasp calculation was success. but the job state was FIZZLED.
the FW--offline.json file is in the attachment.

the job was run successfully in the log-in node.

by the way do you have some experience to manage calculation results? because the file name are look like randomly and in your document the command find_one is not easy to use for large number of calculations.

Thank you!
Best,
Zeying
FW_offline.json

Anubhav Jain

unread,
Jan 30, 2018, 1:52:32 PM1/30/18
to zeying zhang, atomate
Hi Zeying,

Each calculation step ("Firework") of the default atomate workflows consists of multiple steps, e.g.:

(i) Write the VASP input files
(ii) Run VASP
(iii) Parse the VASP outputs **and enter the results into your tasks database**

From what I can tell, (i) and (ii) are happening fine but (iii) is giving an error. This is why the Fireworks shows up as FIZZLED. The reason (iii) is giving an error is because it is trying to enter the results from the VASP calculation into your tasks database, but it cannot do this because your compute nodes cannot connect to external databases (this is presumably why you are running offline mode in the first place).

It is possible to have step (iii) simply write a summary document ("task.json" file) in your calculation directory and not enter anything into the database. This should probably allow step (iii) to complete successfully. To do this, you'd need to modify your my_fworker.yaml file so that the "db_file" parameter of the "env" is set to "null". Thus, if you are following the installation tutorial (https://hackingmaterials.github.io/atomate/installation.html#my-fworker-yaml), you should switch "<<INSTALL_DIR>>/config/db.json" with "null". If atomate is not given a database credential file, it will simply write the summary of the calc to the directory as a "task.json" file. The only way to insert that file into the tasks database is to do this manually, i.e., write a short Python script to open the JSON file and insert it into MongoDB. This should only be a few lines of code (e.g., a dozen or so total).

All this said, I'm not sure it makes so much sense to use atomate if one is using offline mode. It just adds a lot extra overhead and steps.

As for managing calculations (e.g., where are all my calcs located? where is a specific calc located?), there are basically two answers:

1. Use the database to find out where your calculations are. This might include using FireWorks commands (e.g., "lpad get_fw ..." or "lpad get_wflow ..."), or, if you have a "tasks" database of output calculations, to query MongoDb to find the task you want. In both cases, once finding the appropriate calc (or set of calcs) with the database search, there are keys in the document to tell you where the location is. As one example, try something like:

lpad get_wflows -q '{"metadata.formula_reduced_abc": "B1 N2 Y1"}' -d more

(where you put the alphabetical formula of the compound you want)

or

lpad get_wflows -q '{"metadata.chemsys": "B-N-Y"}' -d more

or 

lpad get_wflows -q '{"metadata.formula_anonymous": "ABC2"}' -d more

You can also query your tasks database (if you are able to have one) and get, for example, the locations of all jobs that have band gap > 0, or have a certain e_hull energy, etc.

2. If you want to browse the filesystem (we *rarely* do this, and just use the database 99% of the time), you can use "ls" in conjunction with the namefile that's written by default in atomate workflows. The namefile looks something like "FW--LiFePO4-structure_optimization". Then, if you are sitting in the directory that contains all your "launcher_" directories, you can do something like "ls launcher_*/FW--LiFePO4*" to find all the launcher directories that contain LiFePO4. You can also write your own custom bash script to try to help you identify runs.




For more options, visit https://groups.google.com/d/optout.



--
Best,
Anubhav

jjlo...@gmail.com

unread,
Mar 11, 2018, 1:21:09 PM3/11/18
to atomate
I'm also struggling to run Atomate with the offline mode. Although I followed the suggestions, 'task.json' file has not written.

I used latest Pymatgen, Custodian, and Fireworks. The commands are exactly same with the Zeying's. I found out the vasp claculation was done, but the lpad cannot update due to an error. It looks the custodian zips the "FW_offline.json" when the vasp calculation is once finished, and the error happens before writing 'task.json' file.

I would appreciate if you can suggest another way to make it work. Following is the 'FW_job.error' file

Many thanks,
Sung


------------
Traceback (most recent call last):
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/core/rocket.py", line 243, in run
    Rocket.update_checkpoint(lp, launch_id, checkpoint)
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/core/rocket.py", line 433, in update_checkpoint
    offline_info = loadfn("FW_offline.json")
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/monty/serialization.py", line 71, in loadfn
    with zopen(fn) as fp:
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/monty/io.py", line 71, in zopen
    return open(filename, *args, **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: 'FW_offline.json'
Traceback (most recent call last):
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/core/rocket.py", line 243, in run
    Rocket.update_checkpoint(lp, launch_id, checkpoint)
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/core/rocket.py", line 433, in update_checkpoint
    offline_info = loadfn("FW_offline.json")
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/monty/serialization.py", line 71, in loadfn
    with zopen(fn) as fp:
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/monty/io.py", line 71, in zopen
    return open(filename, *args, **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: 'FW_offline.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sbcho/.conda/envs/sung/bin/rlaunch", line 11, in <module>
    sys.exit(rlaunch())
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/scripts/rlaunch_run.py", line 155, in rlaunch
    launch_rocket(launchpad, fworker, args.fw_id, args.loglvl, pdb_on_exception=args.pdb)
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/core/rocket_launcher.py", line 58, in launch_rocket
    rocket_ran = rocket.run(pdb_on_exception=pdb_on_exception)
  File "/home/sbcho/.conda/envs/sung/lib/python3.6/site-packages/fireworks/core/rocket.py", line 409, in run
    with open('FW_offline.json', 'r+') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'FW_offline.json'


2018년 1월 30일 화요일 오후 12시 52분 32초 UTC-6, Anubhav Jain 님의 말:
To unsubscribe from this group and stop receiving emails from it, send an email to atomate+u...@googlegroups.com.

To post to this group, send email to ato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/atomate/9e0e6e2e-f687-4c82-8f6e-1935d80fbb87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best,
Anubhav

--
You received this message because you are subscribed to the Google Groups "atomate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atomate+u...@googlegroups.com.

To post to this group, send email to ato...@googlegroups.com.



--
Best,
Anubhav

조성범

unread,
Mar 12, 2018, 8:12:03 PM3/12/18
to atomate
Although the issue is solved by turning off gzip functional of the custodian, I'm still struggling with insert 'task.json' to MongoDB. Can you guide me a little bit more?

Thanks in advance,
Sung


2018년 3월 11일 일요일 오후 12시 21분 9초 UTC-5, 조성범 님의 말:

Anubhav Jain

unread,
Mar 14, 2018, 1:27:00 PM3/14/18
to jjlo...@gmail.com, atomate
Hi Sung,

Thank you for reporting the problem. It's possible that the gzip is causing it to fail, since FireWorks is expecting a file called "FW_offline.json" but that file doesn't exist since it's been gzipped to "FW_offline.json.gz"

Does it still fail if you turn off the "gzip_output" option in RunVaspCustodian? i.e. if you set this line of code:

atomate/vasp/firetasks/run_calc.py:119

to be False.

If that works, we can modify FWS so that it also detects a gzipped version of "FW_offline.json", make it easier to turn off the gzip feature in atomate, or avoid having atomate gzip the FW_offline.json file.

Best,
Anubhav

To unsubscribe from this group and stop receiving emails from it, send an email to atomate+unsubscribe@googlegroups.com.

To post to this group, send email to ato...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Best,
Anubhav

Sung Beom Cho

unread,
Mar 14, 2018, 1:27:00 PM3/14/18
to Anubhav Jain, atomate
Thank you so much! It is due to the gzip option. Now it works!


Sung

This e-mail is intended only for the named recipient.

Dissemination, distribution, forwarding, or copying of this e-mail by anyone other than the intended recipient is prohibited.

If you have received it in error, please notify the sender by e-mail and completely delete it. Thank you for your cooperation.

 

The phrase above is the same as the Korean contents below.

 

위 전자우편에 포함된 정보는 지정된 수신인에게만 발송되는 것으로 보안을 유지해야 하는 정보와 법률상 및 기타 사유로 공개가 금지된 정보가 포함돼 있을 수 있습니다.

귀하가 이 전자우편의 지정 수신인이 아니라면 본 메일에 포함된 정보의 전부 또는 일부를 무단으로 보유, 사용하거나 제3자에게 공개, 복사, 전송, 배포해서는 안 됩니다.

본 메일이 잘못 전송되었다면, 전자우편 혹은 전화로 연락해주시고, 메일을 즉시 삭제해 주시기 바랍니다. 협조해 주셔서 감사합니다.



Anubhav Jain

unread,
Mar 14, 2018, 1:48:31 PM3/14/18
to atomate
Hi Sung,

Ok great! I have created an issue to fix the gzip / offline issue for future users. You can track its progress here: https://github.com/hackingmaterials/atomate/issues/215

Regarding your second question about how to put the tasks.json file in a database, unfortunately there is really not a great solution for that. Since your compute nodes  cannot connect to the database (I assume this is why you are using offline mode in the first place), they cannot automatically insert the task documents for you. Currently, you would need to write your own script that would parse the tasks.json and insert it into MongoDB. Unfortunately, if you want to further use the builders down the line, you would also need to assign a "task_id" to each to each document as well.

We don't use offline mode ourselves at all, so unfortunately there isn't too much support or experience for that mode. But if you run into further troubles please do feel free to contact the list again.

조성범

unread,
Mar 14, 2018, 5:21:33 PM3/14/18
to atomate
Hi Anubhav,


Thank you for consistent update. I'm tryting to write down the scripts to put the data into MongoDB. I think executing those script as pre_rocket & post_rocket variables in my_qadapter.yaml might work. The pre_rocket script should write down "task_id" information, and the post_rocket script should wrap it up and upload to MongoDB using the pre-defined function in Atomate. Alternatively, I think I can add another function lpad recover_offline.

However, I'm not sure how Atomate uploads the json data to MongoDB. Which function should I call to upload the data? Once I look up that part, I'll try to write down the script.


Thanks,
Sung



2018년 3월 14일 수요일 오후 12시 48분 31초 UTC-5, Anubhav Jain 님의 말:



--
Best,
Anubhav

Anubhav Jain

unread,
Mar 16, 2018, 2:23:44 PM3/16/18
to atomate
>>  I think executing those script as pre_rocket & post_rocket variables in my_qadapter.yaml might work

If that works, I would think that you wouldn't need the "offline" mode in the first place.

>>  I'm not sure how Atomate uploads the json data to MongoDB

Actually, I realized you don't need to maintain a task_id or anything yourself, so ignore my previous email. Given a tasks.json file, you should just have to:

1. Load the json into a dictionary format using json.load()
2. Call this method: atomate.vasp.database.VaspCalcDb#insert_task with the task_doc argument set to the dictionary above. You might want to try the other arguments (parse_dos and parse_bs) as well depending on whether you think those should be stored in the database.

Best
Anubhav

Anubhav Jain

unread,
Apr 11, 2018, 2:37:48 PM4/11/18
to atomate
Hi

I just wanted to follow up to see whether you were able to make this work or if there is any other help we can provide
Reply all
Reply to author
Forward
0 new messages