Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e39d4c4c authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

Check that CHAMELEON_Init() was successful in testing

parent cd02dbbb
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,7 @@ int __chameleon_init(int cores, int gpus) ...@@ -82,6 +82,7 @@ int __chameleon_init(int cores, int gpus)
int __chameleon_initpar(int ncpus, int ncudas, int nthreads_per_worker) int __chameleon_initpar(int ncpus, int ncudas, int nthreads_per_worker)
{ {
CHAM_context_t *chamctxt; CHAM_context_t *chamctxt;
int res = -1;
/* Create context and insert in the context map */ /* Create context and insert in the context map */
chamctxt = chameleon_context_create(); chamctxt = chameleon_context_create();
...@@ -113,9 +114,9 @@ int __chameleon_initpar(int ncpus, int ncudas, int nthreads_per_worker) ...@@ -113,9 +114,9 @@ int __chameleon_initpar(int ncpus, int ncudas, int nthreads_per_worker)
} }
#endif #endif
RUNTIME_init( chamctxt, ncpus, ncudas, nthreads_per_worker ); res = RUNTIME_init( chamctxt, ncpus, ncudas, nthreads_per_worker );
return CHAMELEON_SUCCESS; return res == 0 ? CHAMELEON_SUCCESS : res;
} }
/** /**
......
...@@ -523,7 +523,12 @@ int main (int argc, char **argv) { ...@@ -523,7 +523,12 @@ int main (int argc, char **argv) {
profile = parameters_getvalue_int( "profile" ); profile = parameters_getvalue_int( "profile" );
forcegpu = parameters_getvalue_int( "forcegpu" ); forcegpu = parameters_getvalue_int( "forcegpu" );
CHAMELEON_Init( ncores, ngpus ); rc = CHAMELEON_Init( ncores, ngpus );
if ( rc != CHAMELEON_SUCCESS ) {
fprintf(stderr, "CHAMELEON_Init failed and returned %d.\n", rc);
return EXIT_FAILURE;
}
/* Set ncores to the right value */ /* Set ncores to the right value */
if ( ncores == -1 ) { if ( ncores == -1 ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment