Skip to content

Commit

Permalink
explicit start of hpctoolkit sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
carns committed Dec 16, 2024
1 parent 314c4b9 commit bca857f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/quintain-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#include <margo-bulk-pool.h>
#include <quintain-server.h>

#ifdef HAVE_HPCTOOLKIT
#include <hpctoolkit.h>
#endif

#include "quintain-rpc.h"
#include "quintain-macros.h"

Expand Down Expand Up @@ -172,6 +176,10 @@ int quintain_provider_deregister(quintain_provider_t provider)
return QTN_SUCCESS;
}

#ifdef HAVE_HPCTOOLKIT
static int hpctoolkit_started = 0;
#endif

static void qtn_work_ult(hg_handle_t handle)
{
margo_instance_id mid = MARGO_INSTANCE_NULL;
Expand All @@ -186,6 +194,13 @@ static void qtn_work_ult(hg_handle_t handle)

memset(&out, 0, sizeof(out));

#ifdef HAVE_HPCTOOLKIT
if (!hpctoolkit_started) {
hpctoolkit_sampling_start();
hpctoolkit_started = 1;
}
#endif

mid = margo_hg_handle_get_instance(handle);
assert(mid);
info = margo_get_info(handle);
Expand Down

0 comments on commit bca857f

Please sign in to comment.