Mentions légales du service

Skip to content
Snippets Groups Projects

Issue17/starpu tags

Merged Mathieu Faverge requested to merge faverge/chameleon:issue17/starpu_tags into master
3 files
+ 52
28
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -34,6 +34,48 @@ static int tag_width = 31;
@@ -34,6 +34,48 @@ static int tag_width = 31;
static int tag_sep = 24;
static int tag_sep = 24;
static int _tag_mpi_initialized_ = 0;
static int _tag_mpi_initialized_ = 0;
 
static inline int
 
chameleon_starpu_tag_init( int user_tag_width,
 
int user_tag_sep )
 
{
 
if (!_tag_mpi_initialized_) {
 
int *tag_ub = NULL;
 
int ok = 0;
 
 
tag_width = user_tag_width;
 
tag_sep = user_tag_sep;
 
 
#if defined(HAVE_STARPU_MPI_COMM_GET_ATTR)
 
starpu_mpi_comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &tag_ub, &ok);
 
#else
 
MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &tag_ub, &ok);
 
#endif
 
 
if ( !ok ) {
 
morse_error("RUNTIME_desc_create", "MPI_TAG_UB not known by StarPU");
 
}
 
 
while ( ((uintptr_t)((1UL<<tag_width) - 1) > (uintptr_t)(*tag_ub) ) &&
 
(tag_width >= TAG_WIDTH_MIN) )
 
{
 
tag_width--;
 
tag_sep--;
 
}
 
 
if ( tag_width < TAG_WIDTH_MIN ) {
 
morse_error("RUNTIME_desc_create", "MPI_TAG_UB too small to identify all the data");
 
return;
 
}
 
 
_tag_mpi_initialized_ = 1;
 
return MORSE_SUCCESS;
 
}
 
else {
 
return MORSE_ERR_REINITIALIZED;
 
}
 
}
 
 
#ifndef HAVE_STARPU_MPI_DATA_REGISTER
#ifndef HAVE_STARPU_MPI_DATA_REGISTER
#define starpu_mpi_data_register( handle_, tag_, owner_ ) \
#define starpu_mpi_data_register( handle_, tag_, owner_ ) \
do { \
do { \
@@ -48,10 +90,9 @@ void RUNTIME_comm_set_tag_sizes( int user_tag_width,
@@ -48,10 +90,9 @@ void RUNTIME_comm_set_tag_sizes( int user_tag_width,
int user_tag_sep )
int user_tag_sep )
{
{
#if defined(CHAMELEON_USE_MPI)
#if defined(CHAMELEON_USE_MPI)
if (_tag_mpi_initialized_ == 0) {
int rc;
tag_width = user_tag_width;
rc = chameleon_starpu_tag_init( user_tag_width, user_tag_sep );
tag_sep = user_tag_sep;
if ( rc != MORSE_SUCCESS ) {
} else {
morse_error("RUNTIME_user_tag_size",
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.");
"must be called before creating any Morse descriptor with MORSE_Desc_create(). The tag sizes will not be modified.");
}
}
@@ -155,30 +196,7 @@ void RUNTIME_desc_create( MORSE_desc_t *desc )
@@ -155,30 +196,7 @@ void RUNTIME_desc_create( MORSE_desc_t *desc )
* Check that we are not going over MPI tag limitations
* Check that we are not going over MPI tag limitations
*/
*/
{
{
if (!_tag_mpi_initialized_) {
chameleon_starpu_tag_init( tag_width, tag_sep );
int *tag_ub = NULL;
int ok = 0;
MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, &tag_ub, &ok);
if ( !ok ) {
morse_error("RUNTIME_desc_create", "MPI_TAG_UB not known by MPI");
}
while ( ((uintptr_t)((1UL<<tag_width) - 1) > (uintptr_t)(*tag_ub) ) &&
(tag_width >= TAG_WIDTH_MIN) )
{
tag_width--;
tag_sep--;
}
if ( tag_width < TAG_WIDTH_MIN ) {
morse_error("RUNTIME_desc_create", "MPI_TAG_UB too small to identify all the data");
return;
}
_tag_mpi_initialized_ = 1;
}
/* Check that we won't create overflow in tags used */
/* Check that we won't create overflow in tags used */
if ( ((uintptr_t)(lnt*lmt)) > ((uintptr_t)(1UL<<tag_sep)) ) {
if ( ((uintptr_t)(lnt*lmt)) > ((uintptr_t)(1UL<<tag_sep)) ) {
Loading