diff --git a/control/control.c b/control/control.c index e875a90030923c08c1bf6cc3da495aff4e661b3b..61068fdb55c8db6ceadc3d6385b3d95aabcc1e94 100644 --- a/control/control.c +++ b/control/control.c @@ -82,6 +82,7 @@ int __chameleon_init(int cores, int gpus) int __chameleon_initpar(int ncpus, int ncudas, int nthreads_per_worker) { CHAM_context_t *chamctxt; + int res = -1; /* Create context and insert in the context map */ chamctxt = chameleon_context_create(); @@ -113,9 +114,9 @@ int __chameleon_initpar(int ncpus, int ncudas, int nthreads_per_worker) } #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; } /** diff --git a/testing/chameleon_ztesting.c b/testing/chameleon_ztesting.c index 6aa508d5ac73892d9c51a15336b01238af2e70a3..39d06bc7a6bb2b56976bc1532f822b3b908caec5 100644 --- a/testing/chameleon_ztesting.c +++ b/testing/chameleon_ztesting.c @@ -523,7 +523,12 @@ int main (int argc, char **argv) { profile = parameters_getvalue_int( "profile" ); 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 */ if ( ncores == -1 ) {