Revision 1ef52ae,
371 bytes
checked in by Thomas Uram <turam@…>, 5 years ago
(diff) |
add mpi example
|
-
Property mode set to
100644
|
Rev | Line | |
---|
[1ef52ae] | 1 | import sys |
---|
| 2 | import genericio as g |
---|
| 3 | import mpi4py.MPI as MPI |
---|
| 4 | import ctypes |
---|
| 5 | if MPI._sizeof(MPI.Comm) == ctypes.sizeof(ctypes.c_int): |
---|
| 6 | MPI_Comm = ctypes.c_int |
---|
| 7 | else: |
---|
| 8 | MPI_Comm = ctypes.c_void_p |
---|
| 9 | comm=MPI.COMM_WORLD |
---|
| 10 | comm_ptr = MPI._addressof(comm) |
---|
| 11 | comm_val = MPI_Comm.from_address(comm_ptr) |
---|
| 12 | x = g.read(comm_val,sys.argv[1],'fof_halo_count fof_halo_mass'.split()) |
---|
| 13 | print(x) |
---|
| 14 | |
---|
Note: See
TracBrowser
for help on using the repository browser.