File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22import sys
33
4+ from mpi4py import MPI
45import numpy as np
56import openpmd_api as io
67
1819 print ("SST engine not available in ADIOS2." )
1920 sys .exit (0 )
2021
22+ comm = MPI .COMM_WORLD
23+
2124 # create a series and specify some global metadata
2225 # change the file extension to .json, .h5 or .bp for regular file writing
23- series = io .Series ("simData.sst " , io .Access_Type .create , config )
26+ series = io .Series ("simData.bp5 " , io .Access_Type .create , config )
2427 series .set_author ("Franz Poeschel <f.poeschel@hzdr.de>" )
2528 series .set_software ("openPMD-api-python-examples" )
2629
5255 dtype = np .dtype ("double" ))
5356 for dim in ["x" , "y" , "z" ]:
5457 pos = electronPositions [dim ]
55- pos .reset_dataset (io .Dataset (local_data .dtype , [length ]))
56- pos [()] = local_data
58+ pos .reset_dataset (
59+ io .Dataset (local_data .dtype , [comm .size * length ])
60+ )
61+ pos [comm .rank * length : (comm .rank + 1 ) * length ] = local_data
5762
5863 # optionally: flush now to clear buffers
5964 iteration .series_flush () # this is a shortcut for `series.flush()`
You can’t perform that action at this time.
0 commit comments