Commit f28af593 authored by Philippe Virouleau's avatar Philippe Virouleau

Adjust macros for Fortran

parent 6b897cb1
...@@ -30,11 +30,11 @@ extern "C" { ...@@ -30,11 +30,11 @@ extern "C" {
/** /**
* FORTRAN API - auxiliary function prototypes * FORTRAN API - auxiliary function prototypes
*/ */
void CHAMELEON_INIT(int *CORES, int *NGPUS, int *INFO) void __CHAMELEON_INIT(int *CORES, int *NGPUS, int *INFO)
{ *INFO = CHAMELEON_Init(*CORES, *NGPUS); } { *INFO = __chameleon_init(*CORES, *NGPUS); }
void CHAMELEON_FINALIZE(int *INFO) void __CHAMELEON_FINALIZE(int *INFO)
{ *INFO = CHAMELEON_Finalize(); } { *INFO = __chameleon_finalize(); }
void CHAMELEON_ENABLE(int *lever, int *INFO) void CHAMELEON_ENABLE(int *lever, int *INFO)
{ *INFO = CHAMELEON_Enable(*lever); } { *INFO = CHAMELEON_Enable(*lever); }
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#define CHAMELEON_WS_FNAME(lcname, UCNAME) CHAMELEON_GLOBAL(chameleon_alloc_workspace_##lcname, CHAMELEON_ALLOC_WORKSPACE_##UCNAME) #define CHAMELEON_WS_FNAME(lcname, UCNAME) CHAMELEON_GLOBAL(chameleon_alloc_workspace_##lcname, CHAMELEON_ALLOC_WORKSPACE_##UCNAME)
#define CHAMELEON_WST_FNAME(lcname, UCNAME) CHAMELEON_GLOBAL(chameleon_alloc_workspace_##lcname##_tile, CHAMELEON_ALLOC_WORKSPACE_##UCNAME##_TILE) #define CHAMELEON_WST_FNAME(lcname, UCNAME) CHAMELEON_GLOBAL(chameleon_alloc_workspace_##lcname##_tile, CHAMELEON_ALLOC_WORKSPACE_##UCNAME##_TILE)
#define CHAMELEON_INIT CHAMELEON_GLOBAL(chameleon_init, CHAMELEON_INIT) #define __CHAMELEON_INIT CHAMELEON_GLOBAL(__chameleon_init, __CHAMELEON_INIT)
#define CHAMELEON_FINALIZE CHAMELEON_GLOBAL(chameleon_finalize, CHAMELEON_FINALIZE) #define __CHAMELEON_FINALIZE CHAMELEON_GLOBAL(__chameleon_finalize, __CHAMELEON_FINALIZE)
#define CHAMELEON_ENABLE CHAMELEON_GLOBAL(chameleon_enable, CHAMELEON_ENABLE) #define CHAMELEON_ENABLE CHAMELEON_GLOBAL(chameleon_enable, CHAMELEON_ENABLE)
#define CHAMELEON_DISABLE CHAMELEON_GLOBAL(chameleon_disable, CHAMELEON_DISABLE) #define CHAMELEON_DISABLE CHAMELEON_GLOBAL(chameleon_disable, CHAMELEON_DISABLE)
#define CHAMELEON_SET CHAMELEON_GLOBAL(chameleon_set, CHAMELEON_SET) #define CHAMELEON_SET CHAMELEON_GLOBAL(chameleon_set, CHAMELEON_SET)
...@@ -46,4 +46,20 @@ ...@@ -46,4 +46,20 @@
#define CHAMELEON_LAPACK_TO_TILE CHAMELEON_GLOBAL(chameleon_lapack_to_tile, CHAMELEON_LAPACK_TO_TILE) #define CHAMELEON_LAPACK_TO_TILE CHAMELEON_GLOBAL(chameleon_lapack_to_tile, CHAMELEON_LAPACK_TO_TILE)
#define CHAMELEON_TILE_TO_LAPACK CHAMELEON_GLOBAL(chameleon_tile_to_lapack, CHAMELEON_TILE_TO_LAPACK) #define CHAMELEON_TILE_TO_LAPACK CHAMELEON_GLOBAL(chameleon_tile_to_lapack, CHAMELEON_TILE_TO_LAPACK)
#if defined(CHAMELEON_SCHED_OPENMP)
#define CHAMELEON_INIT(nworkers, ncudas)\
CALL __CHAMELEON_INIT(nworkers, ncudas)\
!$omp parallel\
!$omp master
#define CHAMELEON_FINALIZE()\
!$omp end master\
!$omp end parallel\
CALL __CHAMELEON_FINALIZE()
#else
#define CHAMELEON_INIT(nworkers, ncudas)\
CALL __CHAMELEON_INIT(nworkers, ncudas)
#define CHAMELEON_FINALIZE()\
CALL __CHAMELEON_FINALIZE()
#endif
#endif /* _chameleon_f77_h_ */ #endif /* _chameleon_f77_h_ */
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* *
* @ingroup Control * @ingroup Control
* *
* CHAMELEON_Init - Initialize CHAMELEON. * @brief Initialize CHAMELEON.
* *
****************************************************************************** ******************************************************************************
* *
...@@ -46,26 +46,19 @@ ...@@ -46,26 +46,19 @@
* *
****************************************************************************** ******************************************************************************
* *
* @return * @retval CHAMELEON_SUCCESS successful exit
* \retval CHAMELEON_SUCCESS successful exit
* *
*/ */
#ifdef CHAMELEON_Init int __chameleon_init(int cores, int gpus)
#undef CHAMELEON_Init
#endif
#ifdef CHAMELEON_Finalize
#undef CHAMELEON_Finalize
#endif
int CHAMELEON_Init(int cores, int gpus)
{ {
return CHAMELEON_InitPar(cores, gpus, -1); return __chameleon_initpar(cores, gpus, -1);
} }
/** /**
* *
* @ingroup Control * @ingroup Control
* *
* CHAMELEON_InitPar - Initialize CHAMELEON. * @brief Initialize CHAMELEON.
* *
****************************************************************************** ******************************************************************************
* *
...@@ -80,11 +73,10 @@ int CHAMELEON_Init(int cores, int gpus) ...@@ -80,11 +73,10 @@ int CHAMELEON_Init(int cores, int gpus)
* *
****************************************************************************** ******************************************************************************
* *
* @return * @retval CHAMELEON_SUCCESS successful exit
* \retval CHAMELEON_SUCCESS successful exit
* *
*/ */
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;
...@@ -125,15 +117,14 @@ int CHAMELEON_InitPar(int ncpus, int ncudas, int nthreads_per_worker) ...@@ -125,15 +117,14 @@ int CHAMELEON_InitPar(int ncpus, int ncudas, int nthreads_per_worker)
* *
* @ingroup Control * @ingroup Control
* *
* CHAMELEON_Finalize - Finalize CHAMELEON. * @brief Finalize CHAMELEON.
* *
****************************************************************************** ******************************************************************************
* *
* @return * @retval CHAMELEON_SUCCESS successful exit
* \retval CHAMELEON_SUCCESS successful exit
* *
*/ */
int CHAMELEON_Finalize(void) int __chameleon_finalize(void)
{ {
CHAM_context_t *chamctxt = chameleon_context_self(); CHAM_context_t *chamctxt = chameleon_context_self();
if (chamctxt == NULL) { if (chamctxt == NULL) {
......
...@@ -79,9 +79,9 @@ int main(int argc, char *argv[]) { ...@@ -79,9 +79,9 @@ int main(int argc, char *argv[]) {
print_header( argv[0], iparam); print_header( argv[0], iparam);
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* /*
...@@ -170,8 +170,14 @@ int main(int argc, char *argv[]) { ...@@ -170,8 +170,14 @@ int main(int argc, char *argv[]) {
free(B); free(B);
free(X); free(X);
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
return EXIT_SUCCESS; return rc;
} }
...@@ -74,9 +74,9 @@ int main(int argc, char *argv[]) { ...@@ -74,9 +74,9 @@ int main(int argc, char *argv[]) {
print_header( argv[0], iparam); print_header( argv[0], iparam);
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* Question chameleon to get the block (tile) size (number of columns) */ /* Question chameleon to get the block (tile) size (number of columns) */
...@@ -220,8 +220,14 @@ int main(int argc, char *argv[]) { ...@@ -220,8 +220,14 @@ int main(int argc, char *argv[]) {
CHAMELEON_Desc_Destroy( &descX ); CHAMELEON_Desc_Destroy( &descX );
CHAMELEON_Desc_Destroy( &descAC ); CHAMELEON_Desc_Destroy( &descAC );
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
return EXIT_SUCCESS; return rc;
} }
...@@ -75,11 +75,12 @@ int main(int argc, char *argv[]) { ...@@ -75,11 +75,12 @@ int main(int argc, char *argv[]) {
print_header( argv[0], iparam); print_header( argv[0], iparam);
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* Question chameleon to get the block (tile) size (number of columns) */ /* Question chameleon to get the block (tile) size (number of columns) */
CHAMELEON_Get( CHAMELEON_TILE_SIZE, &NB ); CHAMELEON_Get( CHAMELEON_TILE_SIZE, &NB );
...@@ -201,8 +202,14 @@ int main(int argc, char *argv[]) { ...@@ -201,8 +202,14 @@ int main(int argc, char *argv[]) {
CHAMELEON_Desc_Destroy( &descX ); CHAMELEON_Desc_Destroy( &descX );
CHAMELEON_Desc_Destroy( &descAC ); CHAMELEON_Desc_Destroy( &descAC );
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
return EXIT_SUCCESS; return rc;
} }
...@@ -53,7 +53,6 @@ int main(int argc, char *argv[]) { ...@@ -53,7 +53,6 @@ int main(int argc, char *argv[]) {
RUNTIME_sequence_t *sequence = NULL; RUNTIME_sequence_t *sequence = NULL;
/* CHAMELEON request uniquely identifies each asynchronous function call */ /* CHAMELEON request uniquely identifies each asynchronous function call */
RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER; RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER;
int status;
/* initialize some parameters with default values */ /* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF]; int iparam[IPARAM_SIZEOF];
...@@ -83,9 +82,9 @@ int main(int argc, char *argv[]) { ...@@ -83,9 +82,9 @@ int main(int argc, char *argv[]) {
print_header( argv[0], iparam); print_header( argv[0], iparam);
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* Question chameleon to get the block (tile) size (number of columns) */ /* Question chameleon to get the block (tile) size (number of columns) */
...@@ -141,10 +140,10 @@ int main(int argc, char *argv[]) { ...@@ -141,10 +140,10 @@ int main(int argc, char *argv[]) {
* have been terminated */ * have been terminated */
CHAMELEON_Sequence_Wait(sequence); CHAMELEON_Sequence_Wait(sequence);
status = sequence->status; rc = sequence->status;
if ( status != 0 ) { if ( rc != CHAMELEON_SUCCESS ) {
fprintf(stderr, "Error in computation (%d)\n", status); fprintf(stderr, "Error in computation (%d)\n", rc);
return EXIT_FAILURE; goto finalize;
} }
CHAMELEON_Sequence_Destroy(sequence); CHAMELEON_Sequence_Destroy(sequence);
...@@ -195,8 +194,14 @@ int main(int argc, char *argv[]) { ...@@ -195,8 +194,14 @@ int main(int argc, char *argv[]) {
CHAMELEON_Desc_Destroy( &descX ); CHAMELEON_Desc_Destroy( &descX );
CHAMELEON_Desc_Destroy( &descAC ); CHAMELEON_Desc_Destroy( &descAC );
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
return EXIT_SUCCESS; return rc;
} }
...@@ -53,7 +53,6 @@ int main(int argc, char *argv[]) { ...@@ -53,7 +53,6 @@ int main(int argc, char *argv[]) {
RUNTIME_sequence_t *sequence = NULL; RUNTIME_sequence_t *sequence = NULL;
/* CHAMELEON request uniquely identifies each asynchronous function call */ /* CHAMELEON request uniquely identifies each asynchronous function call */
RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER; RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER;
int status;
/* initialize some parameters with default values */ /* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF]; int iparam[IPARAM_SIZEOF];
...@@ -86,9 +85,9 @@ int main(int argc, char *argv[]) { ...@@ -86,9 +85,9 @@ int main(int argc, char *argv[]) {
print_header( argv[0], iparam); print_header( argv[0], iparam);
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* set some specific parameters related to CHAMELEON: blocks size and inner-blocking size */ /* set some specific parameters related to CHAMELEON: blocks size and inner-blocking size */
...@@ -145,10 +144,10 @@ int main(int argc, char *argv[]) { ...@@ -145,10 +144,10 @@ int main(int argc, char *argv[]) {
* have been terminated */ * have been terminated */
CHAMELEON_Sequence_Wait(sequence); CHAMELEON_Sequence_Wait(sequence);
status = sequence->status; rc = sequence->status;
if ( status != 0 ) { if ( rc != CHAMELEON_SUCCESS ) {
fprintf(stderr, "Error in computation (%d)\n", status); fprintf(stderr, "Error in computation (%d)\n", rc);
return EXIT_FAILURE; goto finalize;
} }
CHAMELEON_Sequence_Destroy(sequence); CHAMELEON_Sequence_Destroy(sequence);
...@@ -199,6 +198,12 @@ int main(int argc, char *argv[]) { ...@@ -199,6 +198,12 @@ int main(int argc, char *argv[]) {
CHAMELEON_Desc_Destroy( &descX ); CHAMELEON_Desc_Destroy( &descX );
CHAMELEON_Desc_Destroy( &descAC ); CHAMELEON_Desc_Destroy( &descAC );
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
......
...@@ -54,7 +54,6 @@ int main(int argc, char *argv[]) { ...@@ -54,7 +54,6 @@ int main(int argc, char *argv[]) {
RUNTIME_sequence_t *sequence = NULL; RUNTIME_sequence_t *sequence = NULL;
/* CHAMELEON request uniquely identifies each asynchronous function call */ /* CHAMELEON request uniquely identifies each asynchronous function call */
RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER; RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER;
int status;
/* initialize some parameters with default values */ /* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF]; int iparam[IPARAM_SIZEOF];
...@@ -84,9 +83,9 @@ int main(int argc, char *argv[]) { ...@@ -84,9 +83,9 @@ int main(int argc, char *argv[]) {
NGPU = iparam[IPARAM_NCUDAS]; NGPU = iparam[IPARAM_NCUDAS];
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* set some specific parameters related to CHAMELEON: blocks size and inner-blocking size */ /* set some specific parameters related to CHAMELEON: blocks size and inner-blocking size */
...@@ -167,10 +166,10 @@ int main(int argc, char *argv[]) { ...@@ -167,10 +166,10 @@ int main(int argc, char *argv[]) {
* have been terminated */ * have been terminated */
CHAMELEON_Sequence_Wait(sequence); CHAMELEON_Sequence_Wait(sequence);
status = sequence->status; rc = sequence->status;
if ( status != 0 ) { if ( rc != CHAMELEON_SUCCESS ) {
fprintf(stderr, "Error in computation (%d)\n", status); fprintf(stderr, "Error in computation (%d)\n", rc);
return EXIT_FAILURE; goto finalize;
} }
CHAMELEON_Sequence_Destroy(sequence); CHAMELEON_Sequence_Destroy(sequence);
...@@ -225,6 +224,12 @@ int main(int argc, char *argv[]) { ...@@ -225,6 +224,12 @@ int main(int argc, char *argv[]) {
CHAMELEON_Desc_Destroy( &descX ); CHAMELEON_Desc_Destroy( &descX );
CHAMELEON_Desc_Destroy( &descAC ); CHAMELEON_Desc_Destroy( &descAC );
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
......
...@@ -58,7 +58,6 @@ int main(int argc, char *argv[]) { ...@@ -58,7 +58,6 @@ int main(int argc, char *argv[]) {
RUNTIME_sequence_t *sequence = NULL; RUNTIME_sequence_t *sequence = NULL;
/* CHAMELEON request uniquely identifies each asynchronous function call */ /* CHAMELEON request uniquely identifies each asynchronous function call */
RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER; RUNTIME_request_t request = RUNTIME_REQUEST_INITIALIZER;
int status;
/* initialize some parameters with default values */ /* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF]; int iparam[IPARAM_SIZEOF];
...@@ -88,9 +87,9 @@ int main(int argc, char *argv[]) { ...@@ -88,9 +87,9 @@ int main(int argc, char *argv[]) {
NGPU = iparam[IPARAM_NCUDAS]; NGPU = iparam[IPARAM_NCUDAS];
/* Initialize CHAMELEON with main parameters */ /* Initialize CHAMELEON with main parameters */
if ( CHAMELEON_Init( NCPU, NGPU ) != CHAMELEON_SUCCESS ) { int rc = CHAMELEON_Init( NCPU, NGPU );
fprintf(stderr, "Error initializing CHAMELEON library\n"); if (rc != CHAMELEON_SUCCESS) {
return EXIT_FAILURE; goto finalize;
} }
/* set some specific parameters related to CHAMELEON: blocks size and inner-blocking size */ /* set some specific parameters related to CHAMELEON: blocks size and inner-blocking size */
...@@ -175,10 +174,10 @@ int main(int argc, char *argv[]) { ...@@ -175,10 +174,10 @@ int main(int argc, char *argv[]) {
* have been terminated */ * have been terminated */
CHAMELEON_Sequence_Wait(sequence); CHAMELEON_Sequence_Wait(sequence);
status = sequence->status; rc = sequence->status;
if ( status != 0 ) { if ( rc != CHAMELEON_SUCCESS ) {
fprintf(stderr, "Error in computation (%d)\n", status); fprintf(stderr, "Error in computation (%d)\n", rc);
return EXIT_FAILURE; goto finalize;
} }
CHAMELEON_Sequence_Destroy(sequence); CHAMELEON_Sequence_Destroy(sequence);
...@@ -233,6 +232,12 @@ int main(int argc, char *argv[]) { ...@@ -233,6 +232,12 @@ int main(int argc, char *argv[]) {
CHAMELEON_Desc_Destroy( &descX ); CHAMELEON_Desc_Destroy( &descX );
CHAMELEON_Desc_Destroy( &descAC ); CHAMELEON_Desc_Destroy( &descAC );
finalize:
/*
* Required semicolon to have at least one inst
* before the end of OpenMP block.
*/
;
/* Finalize CHAMELEON */ /* Finalize CHAMELEON */
CHAMELEON_Finalize(); CHAMELEON_Finalize();
......
...@@ -80,9 +80,9 @@ BEGIN_C_DECLS ...@@ -80,9 +80,9 @@ BEGIN_C_DECLS
/* Auxiliary */ /* Auxiliary */
int CHAMELEON_Version (int *ver_major, int *ver_minor, int *ver_micro); int CHAMELEON_Version (int *ver_major, int *ver_minor, int *ver_micro);
int CHAMELEON_My_Mpi_Rank (void); int CHAMELEON_My_Mpi_Rank (void);
int CHAMELEON_Init (int nworkers, int ncudas); int __chameleon_init (int nworkers, int ncudas);
int CHAMELEON_InitPar (int nworkers, int ncudas, int nthreads_per_worker); int __chameleon_initpar (int nworkers, int ncudas, int nthreads_per_worker);
int CHAMELEON_Finalize (void); int __chameleon_finalize (void);
int CHAMELEON_Pause (void); int CHAMELEON_Pause (void);
int CHAMELEON_Resume (void); int CHAMELEON_Resume (void);
int CHAMELEON_Distributed_start (void); int CHAMELEON_Distributed_start (void);
...@@ -135,20 +135,46 @@ int CHAMELEON_Sequence_Create (RUNTIME_sequence_t **sequence); ...@@ -135,20 +135,46 @@ int CHAMELEON_Sequence_Create (RUNTIME_sequence_t **sequence);
int CHAMELEON_Sequence_Destroy (RUNTIME_sequence_t *sequence); int CHAMELEON_Sequence_Destroy (RUNTIME_sequence_t *sequence);
int CHAMELEON_Sequence_Wait (RUNTIME_sequence_t *sequence); int CHAMELEON_Sequence_Wait (RUNTIME_sequence_t *sequence);
/**
*
* @ingroup Control
*
* @brief Initialize CHAMELEON.
*
******************************************************************************
*
* @param[in] cores
* Number of cores to use.
*
* @param[in] gpus
* Number of cuda devices to use.
*
******************************************************************************
*
* @retval CHAMELEON_SUCCESS successful exit
*
*/
#if defined(CHAMELEON_SCHED_OPENMP) #if defined(CHAMELEON_SCHED_OPENMP)
#define CHAMELEON_INIT(nworkers, ncudas)\ #define CHAMELEON_Init(nworkers, ncudas)\
CHAMELEON_Init(nworkers, ncudas);\ __chameleon_init(nworkers, ncudas);\
_Pragma("omp parallel")\
_Pragma("omp master")\
{
#define CHAMELEON_InitPar(nworkers, ncudas, nthreads_per_worker)\
__chameleon_initpar(nworkers, ncudas, nthreads_per_worker);\
_Pragma("omp parallel")\ _Pragma("omp parallel")\
_Pragma("omp master")\ _Pragma("omp master")\
{ {
#define CHAMELEON_FINALIZE()\ #define CHAMELEON_Finalize()\
}\ }\
CHAMELEON_Finalize(); __chameleon_finalize();
#else #else
#define CHAMELEON_INIT(nworkers, ncudas)\ #define CHAMELEON_Init(nworkers, ncudas)\
CHAMELEON_Init(nworkers, ncudas); __chameleon_init(nworkers, ncudas);
#define CHAMELEON_FINALIZE()\ #define CHAMELEON_InitPar(nworkers, ncudas, nthreads_per_worker)\
CHAMELEON_Finalize(); __chameleon_initpar(nworkers, ncudas, nthreads_per_worker);
#define CHAMELEON_Finalize()\
__chameleon_finalize();
#endif #endif
END_C_DECLS END_C_DECLS
......
...@@ -58,11 +58,6 @@ ...@@ -58,11 +58,6 @@
#include <starpu.h> #include <starpu.h>
#endif /* defined(CHAMELEON_SCHED_STARPU) */ #endif /* defined(CHAMELEON_SCHED_STARPU) */
#if defined(CHAMELEON_SCHED_OPENMP)
#include <omp.h>
#endif /* defined(CHAMELEON_SCHED_OPENMP) */
#if defined(CHAMELEON_HAVE_GETOPT_H) #if defined(CHAMELEON_HAVE_GETOPT_H)
#include <getopt.h>