import sys import genericio as g import mpi4py.MPI as MPI import ctypes if MPI._sizeof(MPI.Comm) == ctypes.sizeof(ctypes.c_int): MPI_Comm = ctypes.c_int else: MPI_Comm = ctypes.c_void_p comm=MPI.COMM_WORLD comm_ptr = MPI._addressof(comm) comm_val = MPI_Comm.from_address(comm_ptr) x = g.read(comm_val,sys.argv[1],'fof_halo_count fof_halo_mass'.split()) print(x)