Author Topic: loading parallel output dumpfile  (Read 75 times)

pchirkov

  • Newbie
  • *
  • Posts: 2
loading parallel output dumpfile
« on: April 01, 2019, 06:57:45 PM »
Dear Ovito
Is it possible to load multiple files in one pipeline and in one frame? It can be very usefull for working with a big number of atoms stored in many files, produced by parallel LAMMPS output,
e.g. via comand dump mydump all custom 100 dump.step_*.proc_%.lammpstrj id x y z


many thanks,
Pavel

Constanze Kalcher

  • Administrator
  • Full Member
  • *****
  • Posts: 233
Re: loading parallel output dumpfile
« Reply #1 on: April 01, 2019, 08:34:03 PM »
Hi Pavel,

the current issue is that OVITO can only auto-detect a file sequence if there is only one * wildcard character in the filename and you have two in your filepattern (for the timestep and processor).
But it is possible to import your dump files with a little workaround:  In the GUI you can merge the different dump-partitions belonging to the same timestep by using the CombineDataset modifier, see
https://www.ovito.org/manual_testing/particles.modifiers.combine_particle_sets.html.
If e.g. you have used 8 processors, you would have to import the first file sequence "dump.step_*.proc_0.lammpstrj" and then add 7 of those modifiers to your pipeline and make sure you correctly edit the "File sequence" for each new modifier to "dump.step_*.proc_1.lammpstrj", "dump.step_*.proc_2.lammpstrj" etc.
I just tried and it works.

Since that's not really practical, here is a small python script for you that you can save in the same folder where your dump files are. Then simply run it from the GUI (choose File --> Run python script).
Code: [Select]
from ovito.data import *
from ovito.io import import_file
from ovito.modifiers import *
import glob

filepattern = "dump.step_*.proc_"
format = ".lammpstrj"
N_proc = int(sorted(glob.glob("dump.step_*.proc_*"))[-1].split(".proc_")[1].split(".lammpstrj")[0]) + 1

pipeline = import_file(filepattern + "0" + format)
for i in range(1, N_proc):
        modifier = CombineDatasetsModifier()
        modifier.source.load(filepattern + str(i) + format)
        pipeline.modifiers.append(modifier)
pipeline.add_to_scene()

It should import and combine everything automatically into the GUI version of the latest developer version OVITO 3-dev.
Let me know if that works for you.

-Constanze


« Last Edit: April 01, 2019, 08:47:33 PM by Constanze Kalcher »

pchirkov

  • Newbie
  • *
  • Posts: 2
Re: loading parallel output dumpfile
« Reply #2 on: April 02, 2019, 06:26:44 PM »
Many thanks for support. It is working and that's we need.

Pavel