Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 10fe3f83 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

testings: add testing_[start|stop] functions to control timing and introduce submission time

parent cdfdc38b
No related branches found
No related tags found
1 merge request!262Add an option to wait for graph submission before executing in testings
......@@ -44,6 +44,7 @@ static parameter_t parameters[] = {
{ "mtxfmt", "Change the way the matrix is stored (0: global, 1: tiles, 2: OOC)", -32, PARAM_OPTION | PARAM_INPUT | PARAM_OUTPUT, 1, 6, TestValInt, {0}, NULL, pread_int, sprint_int },
{ "profile", "Display the kernel profiling", -33, PARAM_OPTION, 0, 0, TestValInt, {0}, NULL, pread_int, sprint_int },
{ "forcegpu", "Force kernels on GPU", -34, PARAM_OPTION, 0, 0, TestValInt, {0}, NULL, pread_int, sprint_int },
{ "splitsub", "Wait for whole graph submission before execution", 'S', PARAM_OPTION, 0, 0, TestValInt, {0}, NULL, pread_int, sprint_int },
{ NULL, "Machine parameters", 0, PARAM_OPTION, 0, 0, 0, {0}, NULL, NULL, NULL },
{ "threads", "Number of CPU workers per node", 't', PARAM_OPTION | PARAM_OUTPUT, 1, 7, TestValInt, {-1}, NULL, pread_int, sprint_int },
......@@ -101,6 +102,7 @@ static parameter_t parameters[] = {
{ "hlvl", "Tree used for high level reduction between nodes", -23, PARAM_OPTION | PARAM_INPUT | PARAM_OUTPUT, 2, 4, TestValInt, {0}, NULL, pread_int, sprint_int },
{ "domino", "Enable/Disable the domino between upper and lower trees", -24, PARAM_OPTION | PARAM_INPUT | PARAM_OUTPUT, 2, 6, TestValInt, {0}, NULL, pread_int, sprint_int },
{ "tsub", "Graph submission time in s", 999, PARAM_OUTPUT, 2, 13, TestValFixdbl, {0}, NULL, pread_fixdbl, sprint_fixdbl },
{ "time", "Time in s", 1000, PARAM_OUTPUT, 2, 13, TestValFixdbl, {0}, NULL, pread_fixdbl, sprint_fixdbl },
{ "gflops", "GFlop/s", 1001, PARAM_OUTPUT, 2, 13, TestValFixdbl, {0}, NULL, pread_fixdbl, sprint_fixdbl },
{ "RETURN", "Result of the testing: SUCCESS/FAILED", 1002, PARAM_OUTPUT, 2, 7, TestValInt, {0}, NULL, pread_int, sprint_check },
......@@ -493,6 +495,64 @@ parameters_destroy()
return;
}
void
testing_start( testdata_t *tdata )
{
int splitsub = parameters_getvalue_int( "splitsub" );
tdata->sequence = NULL;
tdata->request.status = 0;
tdata->request.schedopt = NULL;
#if defined(CHAMELEON_USE_MPI)
CHAMELEON_Distributed_start();
#endif
if ( splitsub ) {
CHAMELEON_Sequence_Create( &(tdata->sequence) );
CHAMELEON_Pause();
}
/* Register starting time */
tdata->tsub = RUNTIME_get_time();
tdata->texec = tdata->tsub;
}
void
testing_stop( testdata_t *tdata, cham_fixdbl_t flops )
{
int splitsub = parameters_getvalue_int( "splitsub" );
cham_fixdbl_t t0, t1, t2, gflops;
/* Submission is done, we need to start the computations */
if ( splitsub ) {
tdata->tsub = RUNTIME_get_time();
CHAMELEON_Resume();
CHAMELEON_Sequence_Wait( tdata->sequence );
CHAMELEON_Sequence_Destroy( tdata->sequence );
}
#if defined(CHAMELEON_USE_MPI)
CHAMELEON_Distributed_stop();
#endif
t2 = RUNTIME_get_time();
t0 = tdata->texec;
t1 = tdata->tsub;
/*
* texec / Submission / tsub / Execution / t
*
* => texec = t2 - t1
* => tsub = t1 - t0
*/
tdata->tsub = t1 - t0;
tdata->texec = t2 - t1;
gflops = flops * 1.e-9 / tdata->texec;
run_arg_add_fixdbl( tdata->args, "time", tdata->texec );
run_arg_add_fixdbl( tdata->args, "tsub", tdata->tsub );
run_arg_add_fixdbl( tdata->args, "gflops", ( tdata->hres == CHAMELEON_SUCCESS ) ? gflops : -1. );
}
int main (int argc, char **argv) {
int ncores, ngpus, human, check, i, niter;
......
......@@ -695,7 +695,7 @@ const char *common_input[] = { "threads", "gpus", "P", "Q", NULL };
/**
* @brief The common output parameters to all tests
*/
const char *common_output[] = { "time", "gflops", NULL };
const char *common_output[] = { "tsub", "time", "gflops", NULL };
/**
********************************************************************************
......
......@@ -217,6 +217,26 @@ void run_list_destroy( run_list_elt_t *run );
void testing_register( testing_t *test );
/**
* @brief Define the data associated to a single run of a testing
*/
struct testing_;
typedef struct testing_ testing_t;
typedef int (*test_fct_t)( run_arg_list_t *, int );
typedef struct testdata_ {
run_arg_list_t *args; /**< The parameters of the test */
int hres; /**< The returned value of the test */
cham_fixdbl_t texec; /**< The execution time of test */
cham_fixdbl_t tsub; /**< The task submission tome of the test */
RUNTIME_sequence_t *sequence; /**< The sequence to run the test if splitsub */
RUNTIME_request_t request; /**< The request to run the test if splitsub */
} testdata_t;
void testing_start( testdata_t *tdata );
void testing_stop( testdata_t *tdata, cham_fixdbl_t flops );
/**
* @brief Macros to enable distributed synchronization if necessary
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment