nuclear-multimessenger-astronomy / nmma

A pythonic library for probing nuclear physics and cosmology with multimessenger analysis
https://nuclear-multimessenger-astronomy.github.io/nmma/
GNU General Public License v3.0
33 stars 58 forks source link

svdmodel_benchmark multiprocessing #125

Open mcoughlin opened 1 year ago

mcoughlin commented 1 year ago

Running

svdmodel_benchmark --model Bu2019lm --svd-path svdmodels_bns --interpolation-type sklearn_gp --data-path lcs_bns/

I get:

Benchmarking model Bu2019lm on filter ['ps1i', 'ztfi', 'uvotuvw2', 'ps1y', 'ps1r', 'uvotu', 'bessellr', 'ps1g', 'uvotuvm2', 'atlasc', 'bessellux', '2massj', '2massks', 'bessellv', 'sdssu', 'ps1z', 'uvotb', 'uvotwhite', 'atlaso', 'bessellb', '2massh', 'ztfg', 'ztfr', 'besselli', 'uvotuvw1', 'uvotv'] with 4 cpus 0%| | 0/1596 [00:04<?, ?it/s] Traceback (most recent call last): File "/Users/mcoughlin/opt/anaconda3/envs/nmma/bin/svdmodel_benchmark", line 33, in sys.exit(load_entry_point('nmma==0.0.11', 'console_scripts', 'svdmodel_benchmark')()) File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/nmma-0.0.11-py3.9.egg/nmma/em/svdmodel_benchmark.py", line 175, in main chi2_dict_array = p_map(chi2_func, grid_entry_names, num_cpus=args.ncpus) File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/p_tqdm-1.4.0-py3.9.egg/p_tqdm/p_tqdm.py", line 65, in p_map File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/p_tqdm-1.4.0-py3.9.egg/p_tqdm/p_tqdm.py", line 54, in _parallel File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/tqdm/std.py", line 1180, in iter for obj in iterable: File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/multiprocess-0.70.14-py3.9.egg/multiprocess/pool.py", line 748, in next raise value File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/multiprocess-0.70.14-py3.9.egg/multiprocess/pool.py", line 431, in _handle_tasks put(task) File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/multiprocess-0.70.14-py3.9.egg/multiprocess/connection.py", line 209, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/Users/mcoughlin/opt/anaconda3/envs/nmma/lib/python3.9/site-packages/multiprocess-0.70.14-py3.9.egg/multiprocess/connection.py", line 396, in _send_bytes header = struct.pack("!i", n) struct.error: 'i' format requires -2147483648 <= number <= 2147483647

I have fixed the code to turn off multi-processing if ncpus = 1, but unsure if there is a way to lower the memory requirement (which I think is the issue). Maybe doing it filter by filter?

tsunhopang commented 1 year ago

Looking into it now

mcoughlin commented 1 year ago

@tsunhopang Did you figure anything out here?

tsunhopang commented 1 year ago

Not yet, as my run just keep getting struck but without the error message.

On Wed, Jun 28, 2023, 14:35 Michael Coughlin @.***> wrote:

@tsunhopang https://github.com/tsunhopang Did you figure anything out here?

— Reply to this email directly, view it on GitHub https://github.com/nuclear-multimessenger-astronomy/nmma/issues/125#issuecomment-1611321332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFWC4WRHXPB3O632H3ZTDCLXNQQHXANCNFSM6AAAAAAZTCV6R4 . You are receiving this because you were mentioned.Message ID: @.***>