Hardened parallel gadget

This commit is contained in:
Guilhem Lavaux 2014-11-21 15:24:32 +01:00
parent df50699799
commit b8c0efc80f

View File

@ -184,10 +184,10 @@ class _PySimulationAdaptor(PySimulationBase):
cdef class ArrayWrapper: cdef class ArrayWrapper:
cdef void* data_ptr cdef void* data_ptr
cdef int size cdef np.uint64_t size
cdef int type_array cdef int type_array
cdef set_data(self, int size, int type_array, void* data_ptr): cdef set_data(self, np.uint64_t size, int type_array, void* data_ptr):
""" Set the data of the array """ Set the data of the array
This cannot be done in the constructor as it must recieve C-level This cannot be done in the constructor as it must recieve C-level
@ -302,6 +302,19 @@ It loads a gadget-1 snapshot and return a PySimulationBase object. If cpu_id is
return _PySimulationAdaptor(wrap_simudata(data, flags)) return _PySimulationAdaptor(wrap_simudata(data, flags))
def loadParallelGadget(object filename_list, bool loadPosition = True, bool loadVelocity = False, bool loadId = False, bool loadType = False, bool loadMass=False): def loadParallelGadget(object filename_list, bool loadPosition = True, bool loadVelocity = False, bool loadId = False, bool loadType = False, bool loadMass=False):
"""loadGadget(filename list, loadPosition=True, loadVelocity=False, loadId=False, loadType=False)
Arguments:
- filename list: a list or tuple of filenames to load in parallel
Keywords:
- loadPosition: indicate to load positions
- loadVelocity: indicate to load velocities
- loadId: indicate to load id
- loadType: indicate to load particle types
It loads a gadget-1 snapshot and return a PySimulationBase object.
"""
cdef int flags, i, num_files cdef int flags, i, num_files
cdef list out_arrays cdef list out_arrays
cdef SimuData ** data cdef SimuData ** data