Skip to content

Commit

Permalink
Use new feature parsec_devices_print_stats to print per-tp stats if
Browse files Browse the repository at this point in the history
verbose >=4

Signed-off-by: Aurelien Bouteiller <[email protected]>
  • Loading branch information
abouteiller committed Jun 28, 2023
1 parent a0ea91c commit 4bdb0fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ double time_elapsed = 0.0;
double sync_time_elapsed = 0.0;
double alpha = 1.;

uint64_t *dev_stats = NULL;

/**********************************
* Command line arguments
**********************************/
Expand Down Expand Up @@ -737,6 +739,8 @@ void cleanup_parsec(parsec_context_t* parsec, int *iparam)
cublasShutdown();
#endif

if(NULL != dev_stats) parsec_devices_free_statistics(&dev_stats);

parsec_fini(&parsec);

#ifdef PARSEC_HAVE_MPI
Expand Down
6 changes: 6 additions & 0 deletions tests/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
extern char *PARSEC_SCHED_NAME[];
extern int unix_timestamp;
extern char cwd[];
extern uint64_t *dev_stats;

/* Update PASTE_CODE_PROGRESS_KERNEL below if you change this list */
enum iparam_t {
Expand Down Expand Up @@ -231,6 +232,7 @@ static inline int min(int a, int b) { return a < b ? a : b; }
PROFILING_SAVE_iINFO("PARAM_SCHEDULER", iparam[IPARAM_SCHEDULER]);

#define PASTE_CODE_PROGRESS_KERNEL(PARSEC, KERNEL) \
parsec_devices_save_statistics(&dev_stats); \
SYNC_TIME_START(); \
PARSEC_CHECK_ERROR(parsec_context_start(PARSEC), "parsec_context_start"); \
TIME_START(); \
Expand All @@ -239,13 +241,15 @@ static inline int min(int a, int b) { return a < b ? a : b; }
P, Q, gpus, NB, N, \
gflops=(flops/1e9)/sync_time_elapsed)); \
PASTE_PROF_INFO; \
if(loud >= 4) parsec_devices_print_statistics(PARSEC, dev_stats); \
if(loud >= 5 && rank == 0) { \
printf("<DartMeasurement name=\"performance\" type=\"numeric/double\"\n" \
" encoding=\"none\" compression=\"none\">\n" \
"%g\n" \
"</DartMeasurement>\n", \
gflops); \
} \
if(rank==0) fflush(stdout); \
(void)gflops;


Expand All @@ -254,6 +258,7 @@ static inline int min(int a, int b) { return a < b ? a : b; }
parsec_taskpool_t* PARSEC_##KERNEL = dplasma_##KERNEL##_New PARAMS; \
PARSEC_CHECK_ERROR(parsec_context_add_taskpool(PARSEC, PARSEC_##KERNEL), "parsec_context_add_taskpool");\
SYNC_TIME_STOP(); \
parsec_devices_save_statistics(&dev_stats); \
double stime_A = sync_time_elapsed; \
SYNC_TIME_START(); \
PARSEC_CHECK_ERROR(parsec_context_start(PARSEC), "parsec_context_start");\
Expand All @@ -276,6 +281,7 @@ static inline int min(int a, int b) { return a < b ? a : b; }
stime_A,stime_C); \
} \
PASTE_PROF_INFO; \
if(loud >= 4) parsec_devices_print_statistics(PARSEC, dev_stats); \
if(loud >= 5 && rank == 0) { \
printf("<DartMeasurement name=\"performance\" type=\"numeric/double\"\n" \
" encoding=\"none\" compression=\"none\">\n" \
Expand Down

0 comments on commit 4bdb0fb

Please sign in to comment.