From 4678cd89ee6899acf906fde04deafb37af31b64f Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 25 May 2016 18:39:20 +0200 Subject: [PATCH] [SMPI] Fix #include of private header. The file src/instr/instr_smpi.h is still included, but only if TRACE_CALL_LOCATION is set. I need to fix this later, too. This commit also moves a private function to the correct header (smpi/private.hpp) --- include/smpi/smpi.h | 9 ++++++--- src/smpi/private.hpp | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index d392f2579e..a06de05566 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -14,8 +14,6 @@ #include #include -#include "src/instr/instr_smpi.h" - #ifdef _WIN32 #define MPI_CALL(type,name,args) \ type name args; \ @@ -812,12 +810,17 @@ XBT_PUBLIC(unsigned long long) smpi_rastro_timestamp (void); XBT_PUBLIC(void) smpi_sample_1(int global, const char *file, int line, int iters, double threshold); XBT_PUBLIC(int) smpi_sample_2(int global, const char *file, int line); XBT_PUBLIC(void) smpi_sample_3(int global, const char *file, int line); + +/** + * Functions for call location tracing. These functions will be + * called from the user's application! (With the __FILE__ and __LINE__ values + * passed as parameters.) + */ XBT_PUBLIC(void) smpi_trace_set_call_location(const char *file, int line); /** Fortran binding **/ XBT_PUBLIC(void) smpi_trace_set_call_location_(const char *file, int* line); /** Fortran binding + -fsecond-underscore **/ XBT_PUBLIC(void) smpi_trace_set_call_location__(const char *file, int* line); -XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location(void); #define SMPI_SAMPLE_LOCAL(iters,thres) for(smpi_sample_1(0, __FILE__, __LINE__, iters, thres); \ smpi_sample_2(0, __FILE__, __LINE__); \ diff --git a/src/smpi/private.hpp b/src/smpi/private.hpp index f6a71aba27..b0433fc3a5 100644 --- a/src/smpi/private.hpp +++ b/src/smpi/private.hpp @@ -1,6 +1,8 @@ #ifndef SMPI_PRIVATE_HPP #define SMPI_PRIVATE_HPP +#include "src/instr/instr_smpi.h" + #ifdef HAVE_PAPI typedef std::vector> papi_counter_t; @@ -10,3 +12,8 @@ XBT_PRIVATE int smpi_process_event_set(void); extern std::map location2speedup; #endif + +/** + * \brief Returns the last call location (filename, linenumber). Process-specific. + */ +XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location(void); -- 2.20.1