I have Gadget-2 snapshots (each snapshot is saved over 16 files as snapshot_XXX.0 to snapshot_XXX.15 ) containing 1024^3 particles inside a periodic box of side length 160 cMpc/h.
I want to run the FoF halo finder on these snaps with a criteria of a minimum 10 dm particles to identify the halo - hence, I modified the “nMembers” variable from 8 to 10 (in line 34 of EnzoFOF.c and of fof_main.c ) while installing from source
I ran yt-FoF Halo Finder on my snaps - first, in serial mode (i.e. without yt.enable_parallelsim( ) ) and then, in parallel mode (by adding the line - yt.enable_parallelsim( ) ) with different numbers of processors each time (nprocs = 8, 9, 11, 12).
The python code being used for the parallel/serial runs is mentioned below
SERIAL yt-FOF Code :
import yt
import numpy as np
from yt.extensions.astro_analysis.halo_analysis import HaloCatalog
snum=41
snapfile='test_snaps_serial/snapshot_'+('000'+str(snum))[-3:]+".0"
print("-----------------------(start)----------------------------")
print("SNAP = ",snapfile)
data_ds = yt.load(snapfile)
hc = HaloCatalog(data_ds=data_ds,finder_method="fof",finder_kwargs={"ptype": "Halo", "link":-0.0001953125},output_dir="halocats_serial")
hc.create()
PARALLEL yt-FOF Code :
import yt
import numpy as np
from mpi4py import MPI
from yt.extensions.astro_analysis.halo_analysis import HaloCatalog
yt.enable_parallelism()
snum=41
snapfile='test_snaps_parallel/snapshot_'+('000'+str(snum))[-3:]+".0"
data_ds = yt.load(snapfile)
hc = HaloCatalog(data_ds=data_ds,finder_method="fof",finder_kwargs={"ptype": "Halo", "padding": 0.02, "link":-0.0001953125},output_dir="halocats_parallel")
hc.create()
The no. of halos identified from serial mode runs is different from the total no. of halos identified in the parallel mode runs.
In fact, among the various parallel mode runs, the number of identified halos is dependent on the number of processors used for the parallelisation.
Mode Nprocs Total no. of particles filled Total no of halos identified
Serial - 1073741824 1533386
Parallel 8 910287624 1315510
Parallel 9 388695489 550452
Parallel 11 338752779 483369
Parallel 12 579769833 841258
The no of halos identified in the yt-FOF serial mode halo catalogs and the halo statistics (halo mass function) match very accurately with those returned by other FoF halo finders (like P-FoF) working on the same snapshot file. So the serial runs are fine, the problem lies in the parallel mode runs.
From the terminal outputs (see attached files here), I noticed the total number of particles being “filled in” (summed over all processors used) is not the same as the original particle number count ( = 1024^3 = 1073741824) and this may be causing the discrepancy in the determined halo counts.
I am unable to understand how to fix this issue or where exactly I am going wrong in the parallelism implementation (if that is the case). Any suggestions / help in this regard will be highly appreciated.
Thanks and Regards,
Anirban
I have Gadget-2 snapshots (each snapshot is saved over 16 files as snapshot_XXX.0 to snapshot_XXX.15 ) containing 1024^3 particles inside a periodic box of side length 160 cMpc/h.
I want to run the FoF halo finder on these snaps with a criteria of a minimum 10 dm particles to identify the halo - hence, I modified the “nMembers” variable from 8 to 10 (in line 34 of EnzoFOF.c and of fof_main.c ) while installing from source
I ran yt-FoF Halo Finder on my snaps - first, in serial mode (i.e. without yt.enable_parallelsim( ) ) and then, in parallel mode (by adding the line - yt.enable_parallelsim( ) ) with different numbers of processors each time (nprocs = 8, 9, 11, 12).
The python code being used for the parallel/serial runs is mentioned below
SERIAL yt-FOF Code :
PARALLEL yt-FOF Code :
The no. of halos identified from serial mode runs is different from the total no. of halos identified in the parallel mode runs.
In fact, among the various parallel mode runs, the number of identified halos is dependent on the number of processors used for the parallelisation.
The no of halos identified in the yt-FOF serial mode halo catalogs and the halo statistics (halo mass function) match very accurately with those returned by other FoF halo finders (like P-FoF) working on the same snapshot file. So the serial runs are fine, the problem lies in the parallel mode runs.
From the terminal outputs (see attached files here), I noticed the total number of particles being “filled in” (summed over all processors used) is not the same as the original particle number count ( = 1024^3 = 1073741824) and this may be causing the discrepancy in the determined halo counts.
I am unable to understand how to fix this issue or where exactly I am going wrong in the parallelism implementation (if that is the case). Any suggestions / help in this regard will be highly appreciated.
Thanks and Regards,
Anirban