Insert vasprun.xml with VaspToDb Task

Hello everyone!
I’m new here and maybe my question can seem to be stupid, sorry for that in advance.

I have successfully installed the atomate framework and now am trying to insert all my vasprun.xml files into atomate database for later analysis. So, the task is following:
Input: directory with many subdirs with different vasprun.xml files and corresponding POSCAR/CONTCAR/etc.
Task: insert all data from each vasprun.xml in the directory into atomate database(mongodb as i understood).

What is the best practice for that?

I found VaspToDb task, but it seems to work false or I have used that incorrectly.
So, my code(where paths contains all directorises with vasprun.xml files):

launchpad = LaunchPad.auto_load()
launchpad.reset(’’, require_password=False)

tasks = []
for path in paths:
task = VaspToDb(calc_dir=path)
tasks.append(task)

fw = Firework(tasks)
wf = Workflow([fw], name=“test workflow”)
launchpad.add_wf(wf)
rapidfire(launchpad)

Then extract data fro database:
atomate_db = VaspCalcDb.from_db_file(PATH_TO_MY_DB_JSON)

But I cannot observe any inserted data.

Could you help me or give any hints?

Thank you in advance!
Best regards,
yayapa

Hi

When you create the VaspToDb task, do you specify the db_file parameter? This is needed so that the VaspToDb task can actually insert the task into the database. Otherwise it simply writes a JSON file to the directory containing the data, without actually inserting anything in the DB

Hi Anubhav_Jain,
thank you for your reply. I devided my thoughts/questions/answers into 3 separate parts:

  1. I think, the answer is yes. As you can see the line launchpad = LaunchPad.auto_load() is used. Before the db.json and other corresponding files, such as FW_config.yaml were configured. If I print(launchpad), it outputs the server that I set up before. Moreover, through Mongo DB GUI I can observe the changing database. Do I use it correctly?

  2. I tried another approach, namely to create for each poscar a separate workflow. The code:
    for path in paths:
    struct = Structure.from_file(path+‘POSCAR’)
    wf = wf_bandstructure(struct)
    launchpad.add_wf(wf)

where paths are all directories with POSCARs, but now I receive the following error:
FileNotFoundError: [Errno 2] No such file or directory: ‘srun’: ‘srun’.
And the tasks are either FIZZLED or WAITED

  1. Is there any other approaches? Maybe without using VaspToDB task? I just need to insert all information of my vasprun.xml files into database for later analysis.

Best regards,