Skip to content

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

Open

Description

@aaronzedwick

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?

Activity

  1. philipc2 commented on Sep 9, 2024

    @philipc2
    Member

    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

  2. aaronzedwick commented on Sep 10, 2024

    @aaronzedwick
    MemberAuthor

    Hey @philipc2,

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

  3. philipc2 commented on Sep 10, 2024

    @philipc2
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions