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

Add functionality to print patch statistics in ASMStarPC and friends #3875

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pefarrell
Copy link
Contributor

We often would like to know what kind of sizes of patch problems we are dealing with in ASMStarPC and friends.

When using -snes_view, PETSc prints out the size of the first patch on the first processor, but this isn't all that useful; really we want the minimum and maximum.

This adds an option -pc_star_print_patch_statistics that computes the minimum and maximum patch sizes and prints them out in the viewer, if requested.

V = get_function_space(dm)

# Obtain patches from user defined function
ises = self.get_patches(V)
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels slightly extravagant to completely recompute the patch indices just for the sake of this monitor, but it is true that we don't stash these anywhere convenient for us to find. Is it worth stashing them in __init__ so that we don't need to recompute them here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree it's a bit wasteful. I agree we could stash them in __init__ if the option is present. I'll make this change.

Copy link

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake complex8099 ran6518 passed1581 skipped0 failed

Copy link

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake real8105 ran7316 passed789 skipped0 failed

@JHopeCollins
Copy link
Member

This is a really useful option, thanks @pefarrell. Any chance you could add the mean patch size too? Could be useful to know if the min/max are particular outliers or not.

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