Skip to content

Commit

Permalink
Merge branch 'develop' of git.nic.uoregon.edu:/gitroot/xpress-apex in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
khuck committed Mar 4, 2020
2 parents 874455c + 9fbad9e commit c04ef87
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ git_external(perfstubs

find_file(
PERFSTUBS_HEADER
NAMES perfstubs_api/Tool.h
NAMES perfstubs_api/tool.h
PATHS ${PROJECT_SOURCE_DIR}/perfstubs)

if(PERFSTUBS_HEADER)
Expand Down Expand Up @@ -817,7 +817,7 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/pkgconfig/apex.pc.in
${CMAKE_BINARY_DIR}/pkgconfig/apex.pc @ONLY)
INSTALL_FILES(/lib/pkgconfig FILES pkgconfig/apex.pc)

if (APEX_USE_WEAK_SYMBOLS)
if (APEX_USE_WEAK_SYMBOLS)
add_definitions(-DAPEX_USE_WEAK_SYMBOLS)
else()
find_library(DYNAMICLIB dl)
Expand Down
8 changes: 4 additions & 4 deletions src/apex/apex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,16 +1818,16 @@ using namespace apex;

extern "C" {

int apex_init(const char * thread_name, unsigned long int comm_rank,
unsigned long int comm_size) {
int apex_init(const char * thread_name, const uint64_t comm_rank,
const uint64_t comm_size) {
return init(thread_name, comm_rank, comm_size);
}

int apex_init_(unsigned long int comm_rank, unsigned long int comm_size) {
int apex_init_(const uint64_t comm_rank, const uint64_t comm_size) {
return init("FORTRAN thread", comm_rank, comm_size);
}

int apex_init__(unsigned long int comm_rank, unsigned long int comm_size) {
int apex_init__(const uint64_t comm_rank, const uint64_t comm_size) {
return init("FORTRAN thread", comm_rank, comm_size);
}

Expand Down
5 changes: 3 additions & 2 deletions src/apex/apex.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "apex_types.h"
#include "apex_export.h"
#include "stdbool.h"
#include "stdint.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -53,8 +54,8 @@ extern "C" {
\return APEX_NOERROR on success, or APEX_ERROR on failure.
\sa @ref apex_finalize
*/
APEX_EXPORT int apex_init(const char * thread_name, const unsigned int
comm_rank, const unsigned int comm_size);
APEX_EXPORT int apex_init(const char * thread_name, const uint64_t comm_rank,
const uint64_t comm_size);

/**
\brief Dump output from APEX.
Expand Down
46 changes: 23 additions & 23 deletions src/apex/perftool_implementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#include "perfstubs/perfstubs_api/Tool.h"
#include "perfstubs/perfstubs_api/tool.h"
#include <stdlib.h>
#include "apex.h"
#include "thread_instance.hpp"
Expand All @@ -15,54 +15,54 @@ std::mutex my_mutex;

extern "C" {
// library function declarations
void perftool_init(void) {
void ps_initialize(void) {
apex_init("PerfStubs API", 0, 1);
}
void perftool_register_thread(void) {
void ps_register_thread(void) {
apex_register_thread("PerfStubs Thread");
}
void perftool_exit(void) {
void ps_finalize(void) {
apex_exit_thread();
}
void perftool_dump(void) {
void ps_dump_data(void) {
apex_dump(false);
}

// measurement function declarations
void* perftool_timer_create(const char *timer_name) {
void* ps_timer_create(const char *timer_name) {
return strdup(timer_name);
}
void perftool_timer_start(const void *timer) {
void ps_timer_start(const void *timer) {
apex_start(APEX_NAME_STRING, const_cast<void*>(timer));
}
void perftool_timer_stop(const void *timer) {
void ps_timer_stop(const void *timer) {
apex_stop(apex::thread_instance::instance().get_current_profiler());
}
void perftool_dynamic_phase_start(const char *iteration_prefix,
void ps_dynamic_phase_start(const char *iteration_prefix,
int iteration_number) {
std::stringstream ss;
ss << iteration_prefix << " " << iteration_number;
apex_start(APEX_NAME_STRING, (void*)const_cast<char*>(ss.str().c_str()));
}
void perftool_dynamic_phase_stop(const char *iteration_prefix,
void ps_dynamic_phase_stop(const char *iteration_prefix,
int iteration_number) {
apex_stop(apex::thread_instance::instance().get_current_profiler());
}
void* perftool_create_counter(const char *counter_name) {
void* ps_create_counter(const char *counter_name) {
return (void*)(strdup(counter_name));
}
void perftool_sample_counter(const void *counter, double value) {
void ps_sample_counter(const void *counter, double value) {
apex_sample_value((const char *)(counter), value);
}
void perftool_metadata(const char *name, const char *value) {
void ps_set_metadata(const char *name, const char *value) {
// do nothing
}

// data query function declarations
void perftool_get_timer_data(perftool_timer_data_t *timer_data) {
memset(timer_data, 0, sizeof(perftool_timer_data_t));
void ps_get_timer_data(ps_tool_timer_data_t *timer_data) {
memset(timer_data, 0, sizeof(ps_tool_timer_data_t));
}
void perftool_free_timer_data(perftool_timer_data_t *timer_data) {
void ps_free_timer_data(ps_tool_timer_data_t *timer_data) {
if (timer_data == nullptr)
{
return;
Expand All @@ -83,12 +83,12 @@ extern "C" {
timer_data->values = nullptr;
}
}
void perftool_get_counter_data(perftool_counter_data_t *counter_data) {
memset(counter_data, 0, sizeof(perftool_counter_data_t));
void ps_get_counter_data(ps_tool_counter_data_t *counter_data) {
memset(counter_data, 0, sizeof(ps_tool_counter_data_t));
}
void perftool_free_counter_data(perftool_counter_data_t *counter_data) {
void ps_free_counter_data(ps_tool_counter_data_t *counter_data) {
if (counter_data == nullptr)
{
{
return;
}
if (counter_data->counter_names != nullptr)
Expand Down Expand Up @@ -122,10 +122,10 @@ extern "C" {
counter_data->value_sumsqr = nullptr;
}
}
void perftool_get_metadata(perftool_metadata_t *metadata) {
memset(metadata, 0, sizeof(perftool_metadata_t));
void ps_get_metadata(ps_tool_metadata_t *metadata) {
memset(metadata, 0, sizeof(ps_tool_metadata_t));
}
void perftool_free_metadata(perftool_metadata_t *metadata) {
void ps_free_metadata(ps_tool_metadata_t *metadata) {
if (metadata == nullptr)
{
return;
Expand Down

0 comments on commit c04ef87

Please sign in to comment.