diff --git a/control/descriptor.c b/control/descriptor.c index 70472522faa75bcbb364ac4b8353f24ed84a3d76..6f6673618f6111dfcc45aee8f1adabc61e655bb5 100644 --- a/control/descriptor.c +++ b/control/descriptor.c @@ -581,3 +581,31 @@ int MORSE_Desc_Release (MORSE_desc_t *desc) { int MORSE_Desc_Getoncpu(MORSE_desc_t *desc) { return RUNTIME_desc_getoncpu( desc ); } + +/** *************************************************************************** + * + * @ingroup Descriptor + * + * MORSE_user_tag_size - Set the sizes for the MPI tags + * Default value: tag_width=31, tag_sep=24, meaning that the MPI tag is stored in 31 bits, + * with 24 bits for the tile tag and 7 for the descriptor. + * This function must be called before any descriptor creation. + * + ****************************************************************************** + * + * @param[in] user_tag_width + * The new value for tag_width. + * + * @param[in] user_tag_sep + * The new value for tag_sep. + * + ****************************************************************************** + * + * @return + * \retval none + * + *****************************************************************************/ +void MORSE_user_tag_size(int user_tag_width, int user_tag_sep) { + RUNTIME_user_tag_size(user_tag_width, user_tag_sep); + return; +} diff --git a/include/morse.h.in b/include/morse.h.in index f1e5d57b9a2c0e666c5c818366f0259a2baa6528..c5a0edfe274f992fa02e61c34ea7062fe2dd0dea 100644 --- a/include/morse.h.in +++ b/include/morse.h.in @@ -96,6 +96,7 @@ int MORSE_Desc_Destroy (MORSE_desc_t **desc); int MORSE_Desc_Acquire (MORSE_desc_t *desc); int MORSE_Desc_Release (MORSE_desc_t *desc); int MORSE_Desc_Getoncpu(MORSE_desc_t *desc); +void MORSE_user_tag_size(int, int) ; /* Workspaces */ int MORSE_Dealloc_Workspace (MORSE_desc_t **desc); diff --git a/include/runtime.h b/include/runtime.h index 6cd6c2a1415a2e2305b03013d9372e0faa0bb703..eeea0e3f41a695f8ac9672a4a329ff79fbb6e15a 100644 --- a/include/runtime.h +++ b/include/runtime.h @@ -72,6 +72,7 @@ int RUNTIME_desc_acquire (MORSE_desc_t*); /* Release the data described by the descriptor to be used by the StarPU tasks again. */ int RUNTIME_desc_release (MORSE_desc_t*); int RUNTIME_desc_getoncpu (MORSE_desc_t*); +void RUNTIME_user_tag_size (int, int) ; /******************************************************************************* * RUNTIME Options diff --git a/runtime/parsec/control/runtime_descriptor.c b/runtime/parsec/control/runtime_descriptor.c index 2a471292be541c728c6fbf048675a1a7a96ddb36..c9b40556eb95783c2d02d49ef83a73751d45fd86 100644 --- a/runtime/parsec/control/runtime_descriptor.c +++ b/runtime/parsec/control/runtime_descriptor.c @@ -11,6 +11,11 @@ #include "runtime/parsec/include/morse_parsec.h" #include <dague/data.h> +void RUNTIME_user_tag_size(int user_tag_width, int user_tag_sep) { + (void)user_tag_width; + (void)user_tag_sep; +} + void *RUNTIME_mat_alloc( size_t size) { return malloc(size); diff --git a/runtime/quark/control/runtime_descriptor.c b/runtime/quark/control/runtime_descriptor.c index c16000fd484320ded6548c4b7a009c3cbf7fcb7c..ca5061b62261abe1d0e1ebe4ae49a912cdd68cdc 100644 --- a/runtime/quark/control/runtime_descriptor.c +++ b/runtime/quark/control/runtime_descriptor.c @@ -25,6 +25,11 @@ #include <stdlib.h> #include "runtime/quark/include/morse_quark.h" +void RUNTIME_user_tag_size(int user_tag_width, int user_tag_sep) { + (void)user_tag_width; + (void)user_tag_sep; +} + void *RUNTIME_mat_alloc( size_t size) { return malloc(size); diff --git a/runtime/starpu/control/runtime_descriptor.c b/runtime/starpu/control/runtime_descriptor.c index a0a95469fb4a9fdcaf732ccceaa34cab760b2b53..6f8a68c99167b74085ed044336325a610c3382c5 100644 --- a/runtime/starpu/control/runtime_descriptor.c +++ b/runtime/starpu/control/runtime_descriptor.c @@ -28,10 +28,12 @@ #if defined(CHAMELEON_USE_MPI) -/* Take 24 bits for the tile id, and 7 bits for descriptor id */ +/* Take 24 bits for the tile id, and 7 bits for descriptor id. + These values can be changed through the call MORSE_user_tag_size(int tag_width, int tag_sep) */ #define TAG_WIDTH_MIN 20 static int tag_width = 31; static int tag_sep = 24; +static int _tag_mpi_initialized_ = 0; #ifndef HAVE_STARPU_MPI_DATA_REGISTER #define starpu_mpi_data_register( handle_, tag_, owner_ ) \ @@ -49,6 +51,15 @@ static int tag_sep = 24; #define FOLDED 0 #endif +void RUNTIME_user_tag_size(int user_tag_width, int user_tag_sep) { + if (_tag_mpi_initialized_ == 0) { + tag_width=user_tag_width; + tag_sep=user_tag_sep; + } else + morse_error("RUNTIME_user_tag_size", "must be called before creating any Morse descriptor with MORSE_Desc_create(). The tag sizes will not be modified."); +} + + void *RUNTIME_mat_alloc( size_t size) { #if defined(CHAMELEON_SIMULATION) && !defined(STARPU_MALLOC_SIMULATION_FOLDED) && !defined(CHAMELEON_USE_MPI) @@ -111,8 +122,6 @@ void RUNTIME_desc_create( MORSE_desc_t *desc ) * Check that we are not going over MPI tag limitations */ { - static int _tag_mpi_initialized_ = 0; - if (!_tag_mpi_initialized_) { int *tag_ub = NULL; int ok = 0;