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

Ch/psestimate memory #96

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Ch/psestimate memory #96

wants to merge 6 commits into from

Conversation

cahofer
Copy link
Contributor

@cahofer cahofer commented May 6, 2020

A quadratic estimator that is distributed over power spectrum bands.

feat(QuadraticPSEstimationXLarge):

  • a pipeline task to perform the m-mode quadratic powerspectrum estimation distributed over power spectrum bands. This solves the memory error problem when performing power spectrum estimation for large telescope classes. Depends on driftscan PR #91

@cahofer cahofer requested a review from jrs65 May 6, 2020 19:16
@cahofer
Copy link
Contributor Author

cahofer commented Jul 9, 2020

This PR goes along with the one in driftscan. Asking also @tristpinsm and @sjforeman additionally to @jrs65 for review. Thanks!

Copy link
Contributor

@sjforeman sjforeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Perhaps @jrs65 or @tristpinsm should also take a look before the final approval.

return ps


class QuadraticPSEstimationXLarge(QuadraticPSEstimation):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be a separate class at all? Is there any reason this can't just replace the existing implementation? Or if not, merge them and change the behaviour to a config option, or even better, something that gets automatically determined based on the input data size.

Copy link
Contributor Author

@cahofer cahofer Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I could put them into one class and add a config option, but the two classes are fundamentally very different for the following reasons:

  • the QuadraticPSEstimationLarge uses from driftscan the PSMontelCarloLarge class in which the clarray and the qestimator are MPIarrays parallelized over power spectrum bands. This is very different from the original code, in which clarray is gathered on all ranks and qestimators are calculated locally.
  • This class respects the fact that clarray and qestimator are parallelized over bands, therefore the sky data need to be pre-computed for all m first, as each rank needs all m's. This is also very different from the original code, where the sky data were handled parallel in m.

If we were to use a config option - then we would have one class but and if/else statement in the process method handling the two different calculations.

I personally thought a separate class is cleaner, but after all - you are the boss ;)

Comment on lines +84 to +85
if mpiutil.rank0:
print("m, time needed for quadratic pse", m, et - st)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like left over debug statements. Either remove it, or at least improve the formatting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to keep, but agree about improving formatting

Comment on lines +84 to +85
if mpiutil.rank0:
print("m, time needed for quadratic pse", m, et - st)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to keep, but agree about improving formatting

Comment on lines +76 to +78
et = time.time()
if mpiutil.rank0:
print("m, time needed for quadratic pse", m, et - st)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
et = time.time()
if mpiutil.rank0:
print("m, time needed for quadratic pse", m, et - st)
et = time.time()
self.log.debug(f"{m=}, time needed for quadratic pse {et - st}")

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

Successfully merging this pull request may close these issues.

3 participants