You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
import mpytools as mpy
from mpi4py import MPI
mpicomm = MPI.COMM_WORLD
# read a catalog on several ranks
cat = mpy.Catalog.read('one_catalog.fits', columns=['X', 'Y'], mpicomm=mpicomm)
# select a sub part of the catalog
sel = np.random.rand(cat.size) <= 0.5
cat = cat[sel]
print(cat['Y']) # --> create a memory error
A dirty fix is to ready before the selection all the column that you need after the subselection:
import numpy as np
import mpytools as mpy
from mpi4py import MPI
mpicomm = MPI.COMM_WORLD
# read a catalog on several ranks
cat = mpy.Catalog.read('one_catalog.fits', columns=['X', 'Y'], mpicomm=mpicomm)
_, _ = cat['X'], cat['Y']
# select a sub part of the catalog
sel = np.random.rand(cat.size) <= 0.5
cat = cat[sel]
print(cat['Y']) # --> create a memory error
The text was updated successfully, but these errors were encountered:
The following code should raise a memory issue:
A dirty fix is to ready before the selection all the column that you need after the subselection:
The text was updated successfully, but these errors were encountered: