Skip to content

Commit

Permalink
Merge pull request #89 from abouteiller/new/per-tp-stats
Browse files Browse the repository at this point in the history
Use new feature parsec_devices_print_stats to print per-tp stats
  • Loading branch information
abouteiller authored Jan 31, 2024
2 parents f714942 + 0d1e9e7 commit fd1917c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parsec
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 @@ -734,6 +736,8 @@ void cleanup_parsec(parsec_context_t* parsec, int *iparam)
parsec_info_unregister(&parsec_per_stream_infos, CuHI, NULL);
#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 fd1917c

Please sign in to comment.