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

Support for new performance tool suite : LIKWID #6053

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

Conversation

srinivasyadav18
Copy link
Contributor

Proposed Changes

Adds support to use LIKWID using executors

  • Added cmake integration to find and link LIKWID library with HPX
  • Added new executor named likwid_executor
  • Added unit tests for likwid_exectuor

# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

# enable likwid module only if HPX_WITH_LIKWID is set
if(NOT ${HPX_WITH_LIKWID})
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(NOT ${HPX_WITH_LIKWID})
if(NOT HPX_WITH_LIKWID)

hpx_execution
hpx_runtime_local
CMAKE_SUBDIRS examples tests
)
Copy link
Member

Choose a reason for hiding this comment

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

I'm almost certain our cmake-format check will complain about this.

likwid
======

TODO: High-level description of the module.
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind editing this and add a short description of what the module is doing?

Comment on lines +59 to +60
on_start_ = [name]() {likwid_markerStartRegion(name.data());};
on_stop_ = [name]() {likwid_markerStopRegion(name.data());};
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to copy the name twice?

Copy link
Member

Choose a reason for hiding this comment

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

Also, shouldn't this use name.c_str() instead (i.e. ensure the sequence of bytes is zero-terminated)?

thread_hook on_start_;
thread_hook on_stop_;
};

Copy link
Member

Choose a reason for hiding this comment

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

Would you mind adding a CTAD deduction guide that would possibly simplify code? That might even make obsolete the make_likwid_executor helper below.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, things should work with out a deduction guide (and in fact, your test proves that). Let's just get rid of the make_likwid_executor function below.

#pragma once

#include <likwid.h>
#include <hpx/modules/runtime_local.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

Please #include the HPX headers first. Also, shouldn't we wrap all of this header's content in a #if defined(HPX_HAVE_LIKWID)/#endif?

Comment on lines +19 to +32
void likwid_thread_init()
{
auto prev = hpx::get_thread_on_start_func();
hpx::register_thread_on_start_func
(
[prev](std::size_t local_thread_num,std::size_t global_thread_num,
char const* pool_name, char const* name_postfix)
{
likwid_markerThreadInit();
if (!prev.empty())
prev(local_thread_num, global_thread_num, pool_name, name_postfix);
}
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this implementation into the cpp file?

"HPX main exited with non-zero status");

return hpx::util::report_errors();
}
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way for this test to actually verify that Likwid is being used?

@hkaiser hkaiser modified the milestones: 1.9.0, 1.10.0 Apr 20, 2023
@hkaiser hkaiser modified the milestones: 1.10.0, 1.11.0 May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants