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 1) les slaves envoient tout au master (avec MPI/IO ?) 2) les slaves écrivent leur fichier (avec MPI/IO ok) 3) les slaves écrivent dans un meme fichier (avec MPI/IO ok) ###################### nouvelle fct io.ReadBlock -> io.readblock -> mpi_ReadAndSendBlock io.ReadDataBlock -> io.readblock -> mpi_ReadAndSendArray io.WriteArray -> writeblock -> mpi_GatherAndWriteArray io.WriteBlock !!! (1) !!! use npart, not good !!! !!! si on lit pos, et que pos à plusieurs types, !!! on doit distribuer !!! -> il faut faire plusieurs lecture, sans header !!! (2) !!! si mpi4py n'existe pas, il faut que ça marche... 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 # problème sphecifique pour gadget 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