yt-project / yt_astro_analysis

yt astrophysical analysis modules
Other
21 stars 21 forks source link

Problem with producing rockstar halo catalog for GADGET 2 #158

Open osokoliuk opened 1 year ago

osokoliuk commented 1 year ago

Hi. I'm trying to construct halo catalogue with rockstar version of yt_astro_analysis. I reinstalled software a couple of times, made sure that library path to rockstar is right and rockstar-galaxies is compiled properly. However, when I'm trying to run the code below:

import yt
yt.enable_parallelism()

from yt.extensions.astro_analysis.halo_analysis import HaloCatalog

my_sim = yt.load("Snapshots_512/snapshot_012-2")

hc = HaloCatalog(
    data_ds=my_sim,
    finder_method="rockstar", finder_kwargs={"num_writers":3, "num_readers":2},
)
hc.create()

I get the traceback:

yt : [INFO     ] 2022-11-18 19:57:34,150 Global parallel computation enabled: 0 / 6
yt : [INFO     ] 2022-11-18 19:57:34,150 Global parallel computation enabled: 5 / 6
yt : [INFO     ] 2022-11-18 19:57:34,150 Global parallel computation enabled: 1 / 6
yt : [INFO     ] 2022-11-18 19:57:34,150 Global parallel computation enabled: 4 / 6
yt : [INFO     ] 2022-11-18 19:57:34,150 Global parallel computation enabled: 3 / 6
yt : [INFO     ] 2022-11-18 19:57:34,150 Global parallel computation enabled: 2 / 6
P000 yt : [INFO     ] 2022-11-18 19:57:35,707 Calculating time from 1.000e+00 to be 4.354e+17 seconds
P000 yt : [INFO     ] 2022-11-18 19:57:35,717 Assuming length units are in kpc/h (comoving)
P000 yt : [INFO     ] 2022-11-18 19:57:36,690 Parameters: current_time              = 4.3537644494567936e+17 s
P000 yt : [INFO     ] 2022-11-18 19:57:36,693 Parameters: domain_dimensions         = [1 1 1]
P000 yt : [INFO     ] 2022-11-18 19:57:36,697 Parameters: domain_left_edge          = [0. 0. 0.]
P000 yt : [INFO     ] 2022-11-18 19:57:36,702 Parameters: domain_right_edge         = [10000. 10000. 10000.]
P000 yt : [INFO     ] 2022-11-18 19:57:36,704 Parameters: cosmological_simulation   = 1
P000 yt : [INFO     ] 2022-11-18 19:57:36,705 Parameters: current_redshift          = 6.054301504576642e-10
P000 yt : [INFO     ] 2022-11-18 19:57:36,705 Parameters: omega_lambda              = 0.685
P000 yt : [INFO     ] 2022-11-18 19:57:36,705 Parameters: omega_matter              = 0.315
P000 yt : [INFO     ] 2022-11-18 19:57:36,706 Parameters: omega_radiation           = 0.0
P000 yt : [INFO     ] 2022-11-18 19:57:36,707 Parameters: hubble_constant           = 0.674
P001 yt : [WARNING  ] 2022-11-18 19:57:37,209 Cannot import the rockstar interface.  Rockstar will not run.
If you need Rockstar, see the installation instructions at http://yt-astro-analysis.readthedocs.io/.
P002 yt : [WARNING  ] 2022-11-18 19:57:37,209 Cannot import the rockstar interface.  Rockstar will not run.
If you need Rockstar, see the installation instructions at http://yt-astro-analysis.readthedocs.io/.
P002 yt : [INFO     ] 2022-11-18 19:57:37,211 Rockstar is using 2 readers and 3 writers
P003 yt : [WARNING  ] 2022-11-18 19:57:37,209 Cannot import the rockstar interface.  Rockstar will not run.
If you need Rockstar, see the installation instructions at http://yt-astro-analysis.readthedocs.io/.
P003 yt : [INFO     ] 2022-11-18 19:57:37,211 Rockstar is using 2 readers and 3 writers
P004 yt : [WARNING  ] 2022-11-18 19:57:37,209 Cannot import the rockstar interface.  Rockstar will not run.
If you need Rockstar, see the installation instructions at http://yt-astro-analysis.readthedocs.io/.
P004 yt : [INFO     ] 2022-11-18 19:57:37,211 Rockstar is using 2 readers and 3 writers
P005 yt : [WARNING  ] 2022-11-18 19:57:37,209 Cannot import the rockstar interface.  Rockstar will not run.
If you need Rockstar, see the installation instructions at http://yt-astro-analysis.readthedocs.io/.
P005 yt : [INFO     ] 2022-11-18 19:57:37,211 Rockstar is using 2 readers and 3 writers
P000 yt : [WARNING  ] 2022-11-18 19:57:37,211 Cannot import the rockstar interface.  Rockstar will not run.
If you need Rockstar, see the installation instructions at http://yt-astro-analysis.readthedocs.io/.
P001 yt : [INFO     ] 2022-11-18 19:57:37,211 Rockstar is using 2 readers and 3 writers
P000 yt : [INFO     ] 2022-11-18 19:57:37,212 The citation for the Rockstar halo finder can be found at
P000 yt : [INFO     ] 2022-11-18 19:57:37,213 http://adsabs.harvard.edu/abs/2013ApJ...762..109B
P000 yt : [INFO     ] 2022-11-18 19:57:37,213 Rockstar is using 2 readers and 3 writers
P000 yt : [INFO     ] 2022-11-18 19:57:38,782 Allocating for 2.684e+08 particles
Loading particle index: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 512/512 [00:00<00:00, 742.62it/s]
Loading particle index: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 512/512 [00:00<00:00, 3927.47it/s]
P001 yt : [INFO     ] 2022-11-18 19:58:05,379 Total Particle Count: 268435456.
P002 yt : [INFO     ] 2022-11-18 19:58:05,379 Total Particle Count: 268435456.
  File "/Users/oleksii/Downloads/new.py", line 12, in <module>
    hc.create()
  File "/Users/oleksii/Downloads/new.py", line 12, in <module>
    hc.create()
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_catalog.py", line 345, in create
    self._run(save_halos, save_output, njobs=njobs, dynamic=dynamic)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_catalog.py", line 345, in create
    self._run(save_halos, save_output, njobs=njobs, dynamic=dynamic)
  File "/opt/miniconda3/lib/python3.9/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 321, in barrierize
    retval = func(*args, **kwargs)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_catalog.py", line 241, in _run
    self.finder_method(self)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_finding_methods.py", line 40, in __call__
    return self.function(hc, *self.args, **self.kwargs)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_finding_methods.py", line 92, in _rockstar_method
    rh = RockstarHaloFinder(ds, **finder_kwargs)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_finding/rockstar/rockstar.py", line 294, in __init__
    self.handler = rockstar_interface.RockstarInterface(self.ts)
  File "/opt/miniconda3/lib/python3.9/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 321, in barrierize
    retval = func(*args, **kwargs)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_catalog.py", line 241, in _run
    self.finder_method(self)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_finding_methods.py", line 40, in __call__
    return self.function(hc, *self.args, **self.kwargs)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_catalog/halo_finding_methods.py", line 92, in _rockstar_method
    rh = RockstarHaloFinder(ds, **finder_kwargs)
  File "/Users/oleksii/yt_astro_analysis/yt_astro_analysis/halo_analysis/halo_finding/rockstar/rockstar.py", line 294, in __init__
    self.handler = rockstar_interface.RockstarInterface(self.ts)
P002 yt : [ERROR    ] 2022-11-18 19:58:05,431 AttributeError: 'NoneType' object has no attribute 'RockstarInterface'
P002 yt : [ERROR    ] 2022-11-18 19:58:05,431 Error occurred on rank 1.
Abort(1) on node 2 (rank 2 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 1) - process 2
P001 yt : [ERROR    ] 2022-11-18 19:58:05,431 AttributeError: 'NoneType' object has no attribute 'RockstarInterface'
P001 yt : [ERROR    ] 2022-11-18 19:58:05,432 Error occurred on rank 0.
Abort(1) on node 1 (rank 1 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 1) - process 1

What could fix that? It says that Cannot import the rockstar interface. Rockstar will not run. but I'm pretty sure that I set up rockstar correctly.

brittonsmith commented 1 year ago

Hi there, did you also put a file called rockstar.cfg in the yt_astro_analysis repository before running the installation? If that is not present, it will not try to build the rockstar interface. You can also verify whether this is the case by looking inside the directory, yt_astro_analysis/halo_analysis/halo_finding/rockstar. If you do not see a file named rockstar_interface.*.so, then it was not built. Let us know what you find and hopefully we can get this sorted out.

gogoi7 commented 2 weeks ago

Hi I am facing the same issue right now. Were you able to fix this?

brittonsmith commented 2 weeks ago

Hi @gogoi7 , I don't think it was ever established what the issue was. Can you confirm that have a rockstar.cfg file pointing to your rockstar-galaxies installation and that you have a file named rockstar_interface.*.so in yt_astro_analysis/halo_analysis/halo_finding/rockstar?

gogoi7 commented 2 weeks ago

@brittonsmith Thank you for the quick response. Yes, my rockstar.cfg file is pointing to the rockstar-galaxies directory and I have a file "rockstar_interface.cpython-39-x86_64-linux-gnu.so" in yt_astro_analysis/halo_analysis/halo_finding/rockstar.