pNbody/examples/io/parallelio2cec147d54c4master
parallelio
Readme
http://www.mcs.anl.gov/research/projects/mpi/usingmpi2/examples/starting/main.htm
/* example of sequential Unix write into a common file */
mpirun -np 4 ./io1
/* example of parallel Unix write into separate files */
mpirun -np 4 ./io2
/* example of parallel MPI write into separate files */
mpirun -np 4 ./io3
/* example of parallel MPI write into a single file */
mpirun -np 4 ./io4
/* example of parallel MPI write into a single file (arbitrary num of procs) */
mpirun -np 4 ./io5
/* parallel MPI read with arbitrary number of processes*/
mpirun -np 4 ./io6
python http://chrisjbutler.wordpress.com/2010/09/23/mpi4py-parallel-io-example/
all in one
mpirun -np 4 ./io4.py
all in all
mpirun -np 4 ./io3.py
- les slaves envoient tout au master (avec MPI/IO ?)
nouvelle fct
io.ReadBlock -> io.readblock
-> mpi_ReadAndSendBlock
io.ReadDataBlock -> io.readblock
-> mpi_ReadAndSendArray
io.WriteArray -> writeblock
-> mpi_GatherAndWriteArray
io.WriteBlock
new function:
- fct that write a simple header
- may add header
- master read a block and send it
- master gather a block and write it
- read an array and send it
- write an array and send it
- test a faire rapidement ###########
mpirun -np 4 io7.py mpirun -np 4 io4.py mpirun -np 4 io3.py
cat pytest-io3.0 pytest-io3.1 pytest-io3.2 pytest-io3.3 > pytest-io3.dat
see : regor:/home/revaz/io/parallelio/
pos
- gas
- stars
- halo
on veut :
header t0 pos-gas t0 pos-gas t1 pos-gas t2 pos-stars t0 pos-stars t1 pos-stars t2 pos-halo t0 pos-halo t1 pos-halo t2 header t0 WriteGadgetBlock(pos,npart) WriteGadgetBlock WriteHeader WriteArray(pos[]) WriteArray(pos[]) WriteArray(pos[]) WriteHeader
- proposition ######
pio='yes' mode='mpiio' (separate files)
lecture/ecriture en //, avec mpiio
pio='yes' mode='normal' (separate files)
lecture/ecriture en //, bcast sur master
pio='no' mode='mpiio' (single file)
pio='no' mode='normal' (single file)
lecture/ecriture sur un seul fichier tout passe par le master
def WriteArray(f,data,add_header=False,x64=False,byteorder=sys.byteorder)
f = file or MPI.File --> il faut donner le mode pio -> trouver comment donner un defaut piomode -> trouver comment donner un defaut if pio=='yes' and piomode=='mpiio':
mpirun -np 2 test_io.py