Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the speed of read_spectra function #24

Open
biprateep opened this issue Feb 15, 2024 · 0 comments
Open

Improve the speed of read_spectra function #24

biprateep opened this issue Feb 15, 2024 · 0 comments

Comments

@biprateep
Copy link
Collaborator

Here are some of the suggestions, courtesy of Raga Pucha and John Moustakas:

  • Use the read-only directory: '/dvs_ro/cfs/cdirs/desi/spectro/redux/{specprod}/healpix' instead of /global/cfs/...
  • You can do the same thing for fastspecfit files as well: /dvs_ro/cfs/cdirs/desi/spectro/fastspecfit/...
  • In the latest DESI kernel, they have improved the read_spectra() function. You can use "skip_hdus" keyword and it will run faster. Also, you can give a bunch of targets together for a given "SURVEY", "PROGRAM", "HEALPIX"
    spec = read_spectra(coadd_file, skip_hdus = ('EXP_FIBERMAP', 'SCORES', 'EXTRA_CATALOG')).select(targets = targetids)
  • Tip from experience: "DO NOT SKIP MASK HDU". The masks are not applied when you are coadding the spectra across all cameras -- so, keep the MASK HDU for the correct spectra.
  • When using multiprocessing, test for 128 or 64 processes in this line: pool = Pool(processes = 128) - I have noticed that 256 usually slows things down.
  • You can use array jobs instead of a single job -- another way to make things run fast and get nodes assigned easier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant