From 28baad50d2901f3f8b0de665264c2260afc726d8 Mon Sep 17 00:00:00 2001 From: Mathieu Faverge <mathieu.faverge@inria.fr> Date: Tue, 24 May 2022 19:40:58 +0200 Subject: [PATCH] Rename CHAMELEON_{KERNELPROFILE,PROFILING}_MODE to CHAMELEON_GENERATE_{STATS,TRACE} --- control/common.h | 2 +- control/context.c | 24 +++++++++++++----------- doc/user/chapters/using.org | 5 +++-- include/chameleon/constants.h | 6 ++++-- include/chameleon/fortran.h | 15 ++++++++++----- include/chameleon/runtime.h | 4 ++-- include/chameleon/struct.h | 2 +- runtime/openmp/control/runtime_context.c | 14 ++++++++++---- runtime/openmp/control/runtime_options.c | 2 +- runtime/parsec/control/runtime_context.c | 18 ++++++++++++------ runtime/parsec/control/runtime_options.c | 2 +- runtime/quark/control/runtime_context.c | 14 ++++++++++---- runtime/quark/control/runtime_options.c | 2 +- runtime/starpu/control/runtime_context.c | 20 ++++++++++---------- runtime/starpu/control/runtime_control.c | 6 ++++++ runtime/starpu/control/runtime_options.c | 2 +- testing/testings.c | 8 ++++---- 17 files changed, 90 insertions(+), 56 deletions(-) diff --git a/control/common.h b/control/common.h index 85e696d1a..d68934a6c 100644 --- a/control/common.h +++ b/control/common.h @@ -83,7 +83,7 @@ #define CHAMELEON_RHBLK chamctxt->rhblock #define CHAMELEON_TRANSLATION chamctxt->translation #define CHAMELEON_PARALLEL chamctxt->parallel_enabled -#define CHAMELEON_PROFILING chamctxt->profiling_enabled +#define CHAMELEON_STATISTICS chamctxt->statistics_enabled /** * IPT internal define diff --git a/control/context.c b/control/context.c index 827ebc811..dc444168b 100644 --- a/control/context.c +++ b/control/context.c @@ -134,7 +134,7 @@ CHAM_context_t *chameleon_context_create() chamctxt->warnings_enabled = chameleon_env_is_off( "CHAMELEON_WARNINGS" ); chamctxt->autotuning_enabled = chameleon_env_is_on( "CHAMELEON_AUTOTUNING" ); chamctxt->parallel_enabled = chameleon_env_is_on( "CHAMELEON_PARALLEL_KERNEL" ); - chamctxt->profiling_enabled = chameleon_env_is_on( "CHAMELEON_PROFILING_MODE" ); + chamctxt->statistics_enabled = chameleon_env_is_on( "CHAMELEON_GENERATE_STATS" ); chamctxt->progress_enabled = chameleon_env_is_on( "CHAMELEON_PROGRESS" ); chamctxt->generic_enabled = chameleon_env_is_on( "CHAMELEON_GENERIC" ); chamctxt->autominmax_enabled = chameleon_env_is_on( "CHAMELEON_AUTOMINMAX" ); @@ -184,8 +184,9 @@ int chameleon_context_destroy(){ * Feature to be enabled: * @arg CHAMELEON_WARNINGS printing of warning messages, * @arg CHAMELEON_AUTOTUNING autotuning for tile size and inner block size. - * @arg CHAMELEON_PROFILING_MODE activate profiling of kernels - * @arg CHAMELEON_PROGRESS activate progress indicator + * @arg CHAMELEON_GENERATE_TRACE enable/start the trace generation + * @arg CHAMELEON_GENERATE_STATS enable/start the kernel statistics + * @arg CHAMELEON_PROGRESS enable the progress indicator * @arg CHAMELEON_GEMM3M Use z/cgemm3m for complexe matrix-matrix products * @arg CHAMELEON_GENERIC enable/disable GEMM3M Use z/cgemm3m for complexe matrix-matrix products * @@ -212,11 +213,11 @@ int CHAMELEON_Enable(int option) case CHAMELEON_AUTOTUNING: chamctxt->autotuning_enabled = CHAMELEON_TRUE; break; - case CHAMELEON_PROFILING_MODE: + case CHAMELEON_GENERATE_TRACE: RUNTIME_start_profiling(); break; - case CHAMELEON_KERNELPROFILE_MODE: - chamctxt->profiling_enabled = CHAMELEON_TRUE; + case CHAMELEON_GENERATE_STATS: + chamctxt->statistics_enabled = CHAMELEON_TRUE; break; case CHAMELEON_PROGRESS: chamctxt->progress_enabled = CHAMELEON_TRUE; @@ -259,8 +260,9 @@ int CHAMELEON_Enable(int option) * Feature to be disabled: * @arg CHAMELEON_WARNINGS printing of warning messages, * @arg CHAMELEON_AUTOTUNING autotuning for tile size and inner block size. - * @arg CHAMELEON_PROFILING_MODE deactivate profiling of kernels - * @arg CHAMELEON_PROGRESS deactivate progress indicator + * @arg CHAMELEON_GENERATE_TRACE disable/pause the trace generation + * @arg CHAMELEON_GENERATE_STATS disable/pause the kernel statistics + * @arg CHAMELEON_PROGRESS disable the progress indicator * @arg CHAMELEON_GEMM3M Use z/cgemm3m for complexe matrix-matrix products * ******************************************************************************* @@ -285,11 +287,11 @@ int CHAMELEON_Disable(int option) case CHAMELEON_AUTOTUNING: chamctxt->autotuning_enabled = CHAMELEON_FALSE; break; - case CHAMELEON_PROFILING_MODE: + case CHAMELEON_GENERATE_TRACE: RUNTIME_stop_profiling(); break; - case CHAMELEON_KERNELPROFILE_MODE: - chamctxt->profiling_enabled = CHAMELEON_FALSE; + case CHAMELEON_GENERATE_STATS: + chamctxt->statistics_enabled = CHAMELEON_FALSE; break; case CHAMELEON_PROGRESS: chamctxt->progress_enabled = CHAMELEON_FALSE; diff --git a/doc/user/chapters/using.org b/doc/user/chapters/using.org index 91533bfed..cf0d7cc28 100644 --- a/doc/user/chapters/using.org +++ b/doc/user/chapters/using.org @@ -103,7 +103,7 @@ * *CHAMELEON_WARNINGS* enables/disables the warning output * *CHAMELEON_PARALLEL_KERNEL* enables/disables the use of multi-threaded kernels. Available only for StarPU runtime system. - * *CHAMELEON_PROFILING_MODE* enables the profiling information of + * *CHAMELEON_GENERATE_STATS* enables the profiling information of the kernels (StarPU specific) * *CHAMELEON_PROGRESS* enables the progress function to show the percentage of tasks completed. @@ -848,7 +848,8 @@ Features that can be enabled/disabled: * *CHAMELEON_WARNINGS*: printing of warning messages, * *CHAMELEON_AUTOTUNING*: autotuning for tile size and inner block size (inactive), - * *CHAMELEON_PROFILING_MODE*: activate kernels profiling, + * *CHAMELEON_GENERATE_TRACE*: enable/start the trace generation + * *CHAMELEON_GENERATE_STATS*: enable/start the kernel statistics * *CHAMELEON_PROGRESS*: to print a progress status, * *CHAMELEON_GEMM3M*: to enable the use of the /gemm3m/ blas bunction. diff --git a/include/chameleon/constants.h b/include/chameleon/constants.h index 71b18d8d4..d311bf637 100644 --- a/include/chameleon/constants.h +++ b/include/chameleon/constants.h @@ -204,8 +204,10 @@ typedef enum chameleon_store_e { #define CHAMELEON_ERRORS 2 #define CHAMELEON_AUTOTUNING 3 #define CHAMELEON_DAG 4 -#define CHAMELEON_PROFILING_MODE 5 -#define CHAMELEON_KERNELPROFILE_MODE 6 +#define CHAMELEON_GENERATE_TRACE 5 +#define CHAMELEON_PROFILING_MODE CHAMELEON_GENERATE_TRACE /* _deprecated_ */ +#define CHAMELEON_GENERATE_STATS 6 +#define CHAMELEON_KERNELPROFILE_MODE CHAMELEON_GENERATE_STATS /* _deprecated_ */ #define CHAMELEON_PARALLEL_MODE 7 #define CHAMELEON_BOUND 8 #define CHAMELEON_PROGRESS 9 diff --git a/include/chameleon/fortran.h b/include/chameleon/fortran.h index 679eb3a5a..eae7ff7c7 100644 --- a/include/chameleon/fortran.h +++ b/include/chameleon/fortran.h @@ -165,15 +165,20 @@ ! State machine switches ! integer CHAMELEON_WARNINGS, CHAMELEON_ERRORS, CHAMELEON_AUTOTUNING - integer CHAMELEON_DAG, CHAMELEON_PROFILING_MODE, CHAMELEON_PARALLEL_MODE - integer CHAMELEON_BOUND + integer CHAMELEON_DAG, CHAMELEON_GENERATE_TRACE, CHAMELEON_GENERATE_STATS + integer CHAMELEON_PARALLEL_MODE, CHAMELEON_BOUND, CHAMELEON_PROGRESS + integer CHAMELEON_GEMM3M, CHAMELEON_GENERIC parameter ( CHAMELEON_WARNINGS = 1 ) parameter ( CHAMELEON_ERRORS = 2 ) parameter ( CHAMELEON_AUTOTUNING = 3 ) parameter ( CHAMELEON_DAG = 4 ) - parameter ( CHAMELEON_PROFILING_MODE = 5 ) - parameter ( CHAMELEON_PARALLEL_MODE = 6 ) - parameter ( CHAMELEON_BOUND = 7 ) + parameter ( CHAMELEON_GENERATE_TRACE = 5 ) + parameter ( CHAMELEON_GENERATE_STATS = 6 ) + parameter ( CHAMELEON_PARALLEL_MODE = 7 ) + parameter ( CHAMELEON_BOUND = 8 ) + parameter ( CHAMELEON_PROGRESS = 9 ) + parameter ( CHAMELEON_GEMM3M = 10 ) + parameter ( CHAMELEON_GENERIC = 11 ) !******************************************************************** ! CHAMELEON constants - configuration parameters diff --git a/include/chameleon/runtime.h b/include/chameleon/runtime.h index 8794b5618..68642a044 100644 --- a/include/chameleon/runtime.h +++ b/include/chameleon/runtime.h @@ -66,7 +66,7 @@ RUNTIME_context_destroy( CHAM_context_t *ctxt ); * Pointer to the runtime data structure * * @param[in] option - * @arg CHAMELEON_PROFILING_MODE: start the profiling mode of the runtime. + * @arg CHAMELEON_GENERATE_TRACE: start the trace generation mode of the runtime. */ void RUNTIME_enable( void *runtime_ctxt, int option ); @@ -79,7 +79,7 @@ RUNTIME_enable( void *runtime_ctxt, int option ); * Pointer to the runtime data structure * * @param[in] option - * @arg CHAMELEON_PROFILING_MODE: stop the profiling mode of the runtime. + * @arg CHAMELEON_GENERATE_TRACE: stop the trace generation mode of the runtime. */ void RUNTIME_disable( void *runtime_ctxt, int option ); diff --git a/include/chameleon/struct.h b/include/chameleon/struct.h index bd49119df..7e1601012 100644 --- a/include/chameleon/struct.h +++ b/include/chameleon/struct.h @@ -135,7 +135,7 @@ typedef struct chameleon_context_s { cham_bool_t warnings_enabled; cham_bool_t autotuning_enabled; cham_bool_t parallel_enabled; - cham_bool_t profiling_enabled; + cham_bool_t statistics_enabled; cham_bool_t progress_enabled; cham_bool_t generic_enabled; cham_bool_t autominmax_enabled; diff --git a/runtime/openmp/control/runtime_context.c b/runtime/openmp/control/runtime_context.c index a4332ef9f..8faa242f7 100644 --- a/runtime/openmp/control/runtime_context.c +++ b/runtime/openmp/control/runtime_context.c @@ -49,8 +49,11 @@ void RUNTIME_enable( void *runtime_ctxt, int lever ) case CHAMELEON_DAG: fprintf(stderr, "DAG is not available with OpenMP\n"); break; - case CHAMELEON_PROFILING_MODE: - fprintf(stderr, "Profiling is not available with OpenMP\n"); + case CHAMELEON_GENERATE_TRACE: + fprintf(stderr, "Trace generation is not available with OpenMP\n"); + break; + case CHAMELEON_GENERATE_STATS: + fprintf(stderr, "Kernel statistics are not available with OpenMP\n"); break; case CHAMELEON_BOUND: fprintf(stderr, "Bound computation is not available with OpenMP\n"); @@ -72,8 +75,11 @@ void RUNTIME_disable( void *runtime_ctxt, int lever ) case CHAMELEON_DAG: fprintf(stderr, "DAG is not available with OpenMP\n"); break; - case CHAMELEON_PROFILING_MODE: - fprintf(stderr, "Profiling is not available with OpenMP\n"); + case CHAMELEON_GENERATE_TRACE: + fprintf(stderr, "Trace generation is not available with OpenMP\n"); + break; + case CHAMELEON_GENERATE_STATS: + fprintf(stderr, "Kernel statistics are not available with OpenMP\n"); break; case CHAMELEON_BOUND: fprintf(stderr, "Bound computation is not available with OpenMP\n"); diff --git a/runtime/openmp/control/runtime_options.c b/runtime/openmp/control/runtime_options.c index c146c1f26..e626e9fa5 100644 --- a/runtime/openmp/control/runtime_options.c +++ b/runtime/openmp/control/runtime_options.c @@ -26,7 +26,7 @@ void RUNTIME_options_init( RUNTIME_option_t *options, CHAM_context_t *chamctxt, { options->sequence = sequence; options->request = request; - options->profiling = CHAMELEON_PROFILING == CHAMELEON_TRUE; + options->profiling = CHAMELEON_STATISTICS == CHAMELEON_TRUE; options->parallel = CHAMELEON_PARALLEL == CHAMELEON_TRUE; options->priority = RUNTIME_PRIORITY_MIN; options->workerid = -1; diff --git a/runtime/parsec/control/runtime_context.c b/runtime/parsec/control/runtime_context.c index a15d52eee..f2ce0fb3e 100644 --- a/runtime/parsec/control/runtime_context.c +++ b/runtime/parsec/control/runtime_context.c @@ -48,12 +48,15 @@ void RUNTIME_enable( void *runtime_ctxt, int lever ) case CHAMELEON_DAG: fprintf(stderr, "DAG is not available with PaRSEC\n"); break; - case CHAMELEON_PROFILING_MODE: - fprintf(stderr, "Profiling is not available with PaRSEC\n"); + case CHAMELEON_GENERATE_TRACE: + fprintf(stderr, "Trace generation is not available with PaRSEC\n"); //parsec_profiling_start(); break; + case CHAMELEON_GENERATE_STATS: + fprintf(stderr, "Kernel statistics are not available with PaRSEC\n"); + break; case CHAMELEON_BOUND: - fprintf(stderr, "Bound computation is not available with Quark\n"); + fprintf(stderr, "Bound computation is not available with PaRSEC\n"); break; default: return; @@ -73,9 +76,12 @@ void RUNTIME_disable( void *runtime_ctxt, int lever ) case CHAMELEON_DAG: fprintf(stderr, "DAG is not available with PaRSEC\n"); break; - case CHAMELEON_PROFILING_MODE: - fprintf(stderr, "Profiling is not available with PaRSEC\n"); - //parsec_profiling_stop(); + case CHAMELEON_GENERATE_TRACE: + fprintf(stderr, "Trace generation is not available with PaRSEC\n"); + //parsec_profiling_start(); + break; + case CHAMELEON_GENERATE_STATS: + fprintf(stderr, "Kernel statistics are not available with PaRSEC\n"); break; case CHAMELEON_BOUND: fprintf(stderr, "Bound computation is not available with PaRSEC\n"); diff --git a/runtime/parsec/control/runtime_options.c b/runtime/parsec/control/runtime_options.c index dac3176f5..0fe1498b2 100644 --- a/runtime/parsec/control/runtime_options.c +++ b/runtime/parsec/control/runtime_options.c @@ -24,7 +24,7 @@ void RUNTIME_options_init( RUNTIME_option_t *options, CHAM_context_t *chamctxt, { options->sequence = sequence; options->request = request; - options->profiling = CHAMELEON_PROFILING == CHAMELEON_TRUE; + options->profiling = CHAMELEON_STATISTICS == CHAMELEON_TRUE; options->parallel = CHAMELEON_PARALLEL == CHAMELEON_TRUE; options->priority = RUNTIME_PRIORITY_MIN; options->workerid = -1; diff --git a/runtime/quark/control/runtime_context.c b/runtime/quark/control/runtime_context.c index 64b9b183b..41a3bab78 100644 --- a/runtime/quark/control/runtime_context.c +++ b/runtime/quark/control/runtime_context.c @@ -51,8 +51,11 @@ void RUNTIME_enable( void *runtime_ctxt, int lever ) QUARK_Barrier( runtime_ctxt ); QUARK_DOT_DAG_Enable( runtime_ctxt, 1 ); break; - case CHAMELEON_PROFILING_MODE: - fprintf(stderr, "Profiling is not available with Quark\n"); + case CHAMELEON_GENERATE_TRACE: + fprintf(stderr, "Trace generation is not available with Quark\n"); + break; + case CHAMELEON_GENERATE_STATS: + fprintf(stderr, "Kernel statistics are not available with Quark\n"); break; case CHAMELEON_BOUND: fprintf(stderr, "Bound computation is not available with Quark\n"); @@ -74,8 +77,11 @@ void RUNTIME_disable( void *runtime_ctxt, int lever ) QUARK_Barrier( runtime_ctxt ); QUARK_DOT_DAG_Enable( runtime_ctxt, 0 ); break; - case CHAMELEON_PROFILING_MODE: - fprintf(stderr, "Profiling is not available with Quark\n"); + case CHAMELEON_GENERATE_TRACE: + fprintf(stderr, "Trace generation is not available with Quark\n"); + break; + case CHAMELEON_GENERATE_STATS: + fprintf(stderr, "Kernel statistics are not available with Quark\n"); break; case CHAMELEON_BOUND: fprintf(stderr, "Bound computation is not available with Quark\n"); diff --git a/runtime/quark/control/runtime_options.c b/runtime/quark/control/runtime_options.c index fba211462..4723d28e2 100644 --- a/runtime/quark/control/runtime_options.c +++ b/runtime/quark/control/runtime_options.c @@ -36,7 +36,7 @@ void RUNTIME_options_init( RUNTIME_option_t *options, CHAM_context_t *chamctxt, /* Initialize options */ options->sequence = sequence; options->request = request; - options->profiling = CHAMELEON_PROFILING == CHAMELEON_TRUE; + options->profiling = CHAMELEON_STATISTICS == CHAMELEON_TRUE; options->parallel = CHAMELEON_PARALLEL == CHAMELEON_TRUE; options->priority = RUNTIME_PRIORITY_MIN; options->workerid = -1; diff --git a/runtime/starpu/control/runtime_context.c b/runtime/starpu/control/runtime_context.c index d785835ec..c08f30e55 100644 --- a/runtime/starpu/control/runtime_context.c +++ b/runtime/starpu/control/runtime_context.c @@ -79,14 +79,14 @@ void RUNTIME_enable( void *runtime_ctxt, int lever ) switch (lever) { case CHAMELEON_DAG: - fprintf(stderr, "StarPU is providing DAG generation through tracing support (CHAMELEON_PROFILING_MODE)\n"); + fprintf(stderr, "StarPU is providing DAG generation through tracing support (CHAMELEON_GENERATE_TRACE)\n"); break; - case CHAMELEON_KERNELPROFILE_MODE: - context_starpu_flags |= (1 << CHAMELEON_KERNELPROFILE_MODE); + case CHAMELEON_GENERATE_STATS: + context_starpu_flags |= (1 << CHAMELEON_GENERATE_STATS); starpu_profiling_status_set(STARPU_PROFILING_ENABLE); break; - case CHAMELEON_PROFILING_MODE: - context_starpu_flags |= (1 << CHAMELEON_PROFILING_MODE); + case CHAMELEON_GENERATE_TRACE: + context_starpu_flags |= (1 << CHAMELEON_GENERATE_TRACE); starpu_profiling_status_set(STARPU_PROFILING_ENABLE); break; case CHAMELEON_BOUND: @@ -108,16 +108,16 @@ void RUNTIME_disable( void *runtime_ctxt, int lever ) switch (lever) { case CHAMELEON_DAG: - fprintf(stderr, "StarPU is providing DAG generation through tracing support (CHAMELEON_PROFILING_MODE)\n"); + fprintf(stderr, "StarPU is providing DAG generation through tracing support (CHAMELEON_GENERATE_TRACE)\n"); break; - case CHAMELEON_PROFILING_MODE: - context_starpu_flags |= ~(1 << CHAMELEON_PROFILING_MODE); + case CHAMELEON_GENERATE_TRACE: + context_starpu_flags |= ~(1 << CHAMELEON_GENERATE_TRACE); if ( !context_starpu_flags ) { starpu_profiling_status_set(STARPU_PROFILING_DISABLE); } break; - case CHAMELEON_KERNELPROFILE_MODE: - context_starpu_flags |= ~(1 << CHAMELEON_KERNELPROFILE_MODE); + case CHAMELEON_GENERATE_STATS: + context_starpu_flags |= ~(1 << CHAMELEON_GENERATE_STATS); if ( !context_starpu_flags ) { starpu_profiling_status_set(STARPU_PROFILING_DISABLE); } diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c index bcc79254f..554d81eff 100644 --- a/runtime/starpu/control/runtime_control.c +++ b/runtime/starpu/control/runtime_control.c @@ -67,6 +67,12 @@ static int chameleon_starpu_init( starpu_conf_t *conf ) if ( rc == -ENODEV ) { hres = CHAMELEON_ERR_NOT_INITIALIZED; } + + /* Stop profiling as it seems that autostart is not sufficient */ +#if defined(STARPU_USE_FXT) + starpu_fxt_stop_profiling(); +#endif + return hres; } diff --git a/runtime/starpu/control/runtime_options.c b/runtime/starpu/control/runtime_options.c index 98c35eaa0..0fa917acc 100644 --- a/runtime/starpu/control/runtime_options.c +++ b/runtime/starpu/control/runtime_options.c @@ -27,7 +27,7 @@ void RUNTIME_options_init( RUNTIME_option_t *options, CHAM_context_t *chamctxt, starpu_option_request_t* schedopt = (starpu_option_request_t *)(request->schedopt); options->sequence = sequence; options->request = request; - options->profiling = CHAMELEON_PROFILING == CHAMELEON_TRUE; + options->profiling = CHAMELEON_STATISTICS == CHAMELEON_TRUE; options->parallel = CHAMELEON_PARALLEL == CHAMELEON_TRUE; options->priority = RUNTIME_PRIORITY_MIN; options->workerid = (schedopt == NULL) ? -1 : schedopt->workerid; diff --git a/testing/testings.c b/testing/testings.c index d50b392fc..b44047e67 100644 --- a/testing/testings.c +++ b/testing/testings.c @@ -140,12 +140,12 @@ testing_start( testdata_t *tdata ) /* Start kernel statistics */ if ( options.profile && (options.run_id >= 0) ) { - CHAMELEON_Enable( CHAMELEON_KERNELPROFILE_MODE ); + CHAMELEON_Enable( CHAMELEON_GENERATE_STATS ); } /* Start tracing */ if ( options.trace && (options.run_id >= 0) ) { - CHAMELEON_Enable( CHAMELEON_PROFILING_MODE ); + CHAMELEON_Enable( CHAMELEON_GENERATE_TRACE ); } /* @@ -204,12 +204,12 @@ testing_stop( testdata_t *tdata, cham_fixdbl_t flops ) /* Stop tracing */ if ( options.trace && (options.run_id >= 0) ) { - CHAMELEON_Disable( CHAMELEON_PROFILING_MODE ); + CHAMELEON_Disable( CHAMELEON_GENERATE_TRACE ); } /* Stop kernel statistics */ if ( options.profile && (options.run_id >= 0) ) { - CHAMELEON_Disable( CHAMELEON_KERNELPROFILE_MODE ); + CHAMELEON_Disable( CHAMELEON_GENERATE_STATS ); } #endif -- GitLab