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

ASV Profiling doesn't work with multiply file resolutions #2

Open
aaronzedwick opened this issue Sep 6, 2024 · 3 comments
Open

ASV Profiling doesn't work with multiply file resolutions #2

aaronzedwick opened this issue Sep 6, 2024 · 3 comments

Comments

@aaronzedwick
Copy link
Member

In some of our benchmarks (mpas_ocean specifically) there is a test of two files, 120km and 480km. Profiling fails when this is the case. Changing the code to only use one file allows profiling to work again:

class ConstructTreeStructures:

    def setup(self):
        self.uxds = ux.open_dataset(file_path_dict['120km'][0], file_path_dict['120km'][1])

    def teardown(self):
        del self.uxds

    def time_kd_tree(self):
        self.uxds.uxgrid.get_kd_tree()

    def time_ball_tree(self):
        self.uxds.uxgrid.get_ball_tree()

Running asv profile mpas_ocean.ConstructTreeStructures.time_kd_tree --python=same --gui=snakeviz with the normal unchanged class gives an error: mpas_ocean.ConstructTreeStructures.time_kd_tree' benchmark not found. Is there a way around this, or is this a problem on our end?

@philipc2
Copy link
Member

philipc2 commented Sep 9, 2024

Hi @aaronzedwick

The benchmarks with two resolutions are parameterized, which makes sense that it fail with asv profile since it expects a single run of a benchmark (i.e. only one of the parameters)

You may find this usefull.

Can you try running the following:

asv profile mpas_ocean.ConstructTreeStructures.time_kd_tree("120km") --python=same --gui=snakeviz

EDIT: the following might work:
asv profile 'mpas_ocean.ConstructTreeStructures.time_kd_tree\("120km"\)' --python=same --gui=snakeviz

@aaronzedwick
Copy link
Member Author

Hey @philipc2,

It still says 'mpas_ocean.ConstructTreeStructures.time_kd_tree\("120km"\)' benchmark not found.

@philipc2
Copy link
Member

Hey @philipc2,

It still says 'mpas_ocean.ConstructTreeStructures.time_kd_tree\("120km"\)' benchmark not found.

Interesting, I'll look into it.

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

2 participants