Commit 2f441bb8 authored by THIBAULT Samuel's avatar THIBAULT Samuel

Adding pruning stats on top of memaccess

parent afbd9e49
...@@ -232,6 +232,13 @@ if(CHAMELEON_SCHED_STARPU) ...@@ -232,6 +232,13 @@ if(CHAMELEON_SCHED_STARPU)
message("-- ${BoldGreen}CHAMELEON_SIMULATION is set to OFF, turn it ON to use" message("-- ${BoldGreen}CHAMELEON_SIMULATION is set to OFF, turn it ON to use"
" SIMULATION mode (only with StarPU compiled with SimGrid)${ColourReset}") " SIMULATION mode (only with StarPU compiled with SimGrid)${ColourReset}")
endif() endif()
option(CHAMELEON_ENABLE_PRUNING_STATS "Enable pruning statistics" OFF)
if (NOT CHAMELEON_ENABLE_PRUNING_STATS)
message("-- ${BoldGreen}CHAMELEON_ENABLE_PRUNING_STATS is set to OFF, turn it ON to build pruning statistics${ColourReset}")
endif()
if(CHAMELEON_ENABLE_PRUNING_STATS)
add_definitions(-DCHAMELEON_ENABLE_PRUNING_STATS)
endif(CHAMELEON_ENABLE_PRUNING_STATS)
endif() endif()
# Initially we need to generate files for different precisions # Initially we need to generate files for different precisions
......
...@@ -126,6 +126,9 @@ double RUNTIME_get_time(); ...@@ -126,6 +126,9 @@ double RUNTIME_get_time();
void RUNTIME_start_profiling(); void RUNTIME_start_profiling();
void RUNTIME_stop_profiling(); void RUNTIME_stop_profiling();
void RUNTIME_start_stats();
void RUNTIME_stop_stats();
#if defined(PRECISION_z) #if defined(PRECISION_z)
void RUNTIME_zdisplay_allprofile (); void RUNTIME_zdisplay_allprofile ();
void RUNTIME_zdisplay_oneprofile (MORSE_kernel_t); void RUNTIME_zdisplay_oneprofile (MORSE_kernel_t);
......
...@@ -88,6 +88,16 @@ void RUNTIME_stop_profiling() ...@@ -88,6 +88,16 @@ void RUNTIME_stop_profiling()
morse_warning("RUNTIME_stop_profiling()", "FxT profiling is not available with PaRSEC\n"); morse_warning("RUNTIME_stop_profiling()", "FxT profiling is not available with PaRSEC\n");
} }
void RUNTIME_start_stats()
{
morse_warning("RUNTIME_start_stats()", "pruning stats are not available with PaRSEC\n");
}
void RUNTIME_stop_stats()
{
morse_warning("RUNTIME_stop_stats()", "pruning stats are not available with PaRSEC\n");
}
void RUNTIME_schedprofile_display(void) void RUNTIME_schedprofile_display(void)
{ {
morse_warning("RUNTIME_schedprofile_display(parsec)", "Scheduler profiling is not available with PaRSEC\n"); morse_warning("RUNTIME_schedprofile_display(parsec)", "Scheduler profiling is not available with PaRSEC\n");
......
...@@ -103,6 +103,16 @@ void RUNTIME_stop_profiling() ...@@ -103,6 +103,16 @@ void RUNTIME_stop_profiling()
morse_warning("RUNTIME_stop_profiling()", "FxT profiling is not available with Quark\n"); morse_warning("RUNTIME_stop_profiling()", "FxT profiling is not available with Quark\n");
} }
void RUNTIME_start_stats()
{
morse_warning("RUNTIME_start_stats()", "pruning stats are not available with Quark\n");
}
void RUNTIME_stop_stats()
{
morse_warning("RUNTIME_stop_stats()", "pruning stats are not available with Quark\n");
}
void RUNTIME_schedprofile_display(void) void RUNTIME_schedprofile_display(void)
{ {
morse_warning("RUNTIME_schedprofile_display(quark)", "Scheduler profiling is not available with Quark\n"); morse_warning("RUNTIME_schedprofile_display(quark)", "Scheduler profiling is not available with Quark\n");
......
...@@ -29,6 +29,12 @@ ...@@ -29,6 +29,12 @@
#include <starpu_fxt.h> #include <starpu_fxt.h>
#endif #endif
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
unsigned long RUNTIME_total_tasks;
unsigned long RUNTIME_exec_tasks;
unsigned long RUNTIME_comm_tasks;
unsigned long RUNTIME_changed_tasks;
#endif
double RUNTIME_get_time(){ double RUNTIME_get_time(){
return starpu_timing_now()*1e-6; return starpu_timing_now()*1e-6;
...@@ -50,6 +56,21 @@ void RUNTIME_stop_profiling(){ ...@@ -50,6 +56,21 @@ void RUNTIME_stop_profiling(){
#endif #endif
} }
void RUNTIME_start_stats(){
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
RUNTIME_total_tasks = 0;
RUNTIME_exec_tasks = 0;
RUNTIME_comm_tasks = 0;
RUNTIME_changed_tasks = 0;
#endif
}
void RUNTIME_stop_stats(){
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
fprintf(stderr, "\ntasks: %u = exec: %u + comm: %u + changed: %u\n", RUNTIME_total_tasks, RUNTIME_exec_tasks, RUNTIME_comm_tasks, RUNTIME_changed_tasks);
#endif
}
void RUNTIME_profiling_display_info(const char *kernel_name, measure_t perf[STARPU_NMAXWORKERS]) void RUNTIME_profiling_display_info(const char *kernel_name, measure_t perf[STARPU_NMAXWORKERS])
{ {
int header = 1; int header = 1;
......
...@@ -86,16 +86,52 @@ typedef struct starpu_conf starpu_conf_t; ...@@ -86,16 +86,52 @@ typedef struct starpu_conf starpu_conf_t;
void RUNTIME_set_reduction_methods(starpu_data_handle_t handle, MORSE_enum dtyp); void RUNTIME_set_reduction_methods(starpu_data_handle_t handle, MORSE_enum dtyp);
#define RUNTIME_BEGIN_ACCESS_DECLARATION #ifdef CHAMELEON_ENABLE_PRUNING_STATS
#define RUNTIME_PRUNING_STATS_BEGIN_ACCESS_DECLARATION \
int __morse_exec = 0; \
int __morse_changed = 0;
#define RUNTIME_PRUNING_STATS_ACCESS_W(A, Am, An) \
if (morse_desc_islocal(A, Am, An)) \
__morse_exec = 1;
#define RUNTIME_PRUNING_STATS_END_ACCESS_DECLARATION \
RUNTIME_total_tasks++; \
if (__morse_exec) \
RUNTIME_exec_tasks++; \
else if (__morse_need_submit) \
RUNTIME_comm_tasks++; \
else if (__morse_changed) \
RUNTIME_changed_tasks++;
#define RUNTIME_PRUNING_STATS_RANK_CHANGED(rank) \
int __morse_myrank; \
RUNTIME_comm_rank(&__morse_myrank); \
__morse_exec = (rank) == __morse_myrank; \
__morse_changed = 1; \
#define RUNTIME_ACCESS_R(A, Am, An) #else
#define RUNTIME_PRUNING_STATS_BEGIN_ACCESS_DECLARATION
#define RUNTIME_PRUNING_STATS_ACCESS_W(A, Am, An)
#define RUNTIME_PRUNING_STATS_END_ACCESS_DECLARATION
#endif
#define RUNTIME_BEGIN_ACCESS_DECLARATION \
RUNTIME_PRUNING_STATS_BEGIN_ACCESS_DECLARATION
#define RUNTIME_ACCESS_R(A, Am, An) \
#define RUNTIME_ACCESS_W(A, Am, An) #define RUNTIME_ACCESS_W(A, Am, An) \
RUNTIME_PRUNING_STATS_ACCESS_W(A, Am, An)
#define RUNTIME_ACCESS_RW(A, Am, An) #define RUNTIME_ACCESS_RW(A, Am, An) \
RUNTIME_PRUNING_STATS_ACCESS_W(A, Am, An)
#define RUNTIME_RANK_CHANGED(rank) #define RUNTIME_RANK_CHANGED(rank) \
RUNTIME_PRUNING_STATS_RANK_CHANGED(rank)
#define RUNTIME_END_ACCESS_DECLARATION #define RUNTIME_END_ACCESS_DECLARATION \
RUNTIME_PRUNING_STATS_END_ACCESS_DECLARATION;
#endif /* _MORSE_STARPU_H_ */ #endif /* _MORSE_STARPU_H_ */
...@@ -26,6 +26,13 @@ ...@@ -26,6 +26,13 @@
#ifndef _PROFILING_H_ #ifndef _PROFILING_H_
#define _PROFILING_H_ #define _PROFILING_H_
#ifdef CHAMELEON_ENABLE_PRUNING_STATS
extern unsigned long RUNTIME_total_tasks;
extern unsigned long RUNTIME_exec_tasks;
extern unsigned long RUNTIME_comm_tasks;
extern unsigned long RUNTIME_changed_tasks;
#endif
typedef struct measure_s { typedef struct measure_s {
double sum; double sum;
double sum2; double sum2;
......
...@@ -159,6 +159,7 @@ enum dparam_timing { ...@@ -159,6 +159,7 @@ enum dparam_timing {
* *
*/ */
#define START_TRACING() \ #define START_TRACING() \
RUNTIME_start_stats(); \
if(iparam[IPARAM_TRACE] == 2) { \ if(iparam[IPARAM_TRACE] == 2) { \
RUNTIME_start_profiling(); \ RUNTIME_start_profiling(); \
} \ } \
...@@ -167,6 +168,7 @@ enum dparam_timing { ...@@ -167,6 +168,7 @@ enum dparam_timing {
} }
#define STOP_TRACING() \ #define STOP_TRACING() \
RUNTIME_stop_stats(); \
if(iparam[IPARAM_TRACE] == 2) { \ if(iparam[IPARAM_TRACE] == 2) { \
RUNTIME_stop_profiling(); \ RUNTIME_stop_profiling(); \
} \ } \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment