Mentions légales du service

Skip to content
Snippets Groups Projects

Add Out-of-Core option

Merged THIBAULT Samuel requested to merge thibault/chameleon:ooc into master
10 files
+ 143
10
Compare changes
  • Side-by-side
  • Inline
Files
10
  • 3e6305c6
    Add Out-of-Core option · 3e6305c6
    THIBAULT Samuel authored
    Add MORSE_Desc_Create_OOC, which is like MORSE_Desc_Create, but does not
    actually allocate a matrix, thus letting the runtime allocate on-demand the
    tiles, possibly pushing them to the disk.
    
    Add a --ooc option to tests to enable this.
+ 87
0
@@ -379,6 +379,93 @@ int MORSE_Desc_Create(MORSE_desc_t **desc, void *mat, MORSE_enum dtyp, int mb, i
return MORSE_SUCCESS;
}
/** ***************************************************************************
*
* @ingroup Descriptor
*
* MORSE_Desc_Create_OOC - Create matrix descriptor for matrix which may not fit memory
*
******************************************************************************
*
* @param[out] desc
* On exit, descriptor of the matrix.
*
* @param[in] dtyp
* Data type of the matrix:
* @arg MorseRealFloat: single precision real (S),
* @arg MorseRealDouble: double precision real (D),
* @arg MorseComplexFloat: single precision complex (C),
* @arg MorseComplexDouble: double precision complex (Z).
*
* @param[in] nb
* Number of rows and columns in a tile.
*
* @param[in] m
* Number of rows of the entire matrix.
*
* @param[in] n
* Number of columns of the entire matrix.
*
* @param[in] p
* 2d-block cyclic partitioning, number of tiles in rows.
*
* @param[in] q
* 2d-block cyclic partitioning, number of tiles in columns.
*
* @param[in] (*get_rankof)( const MORSE_desc_t *A, int m, int n)
* A function that return the MPI rank of the tile A(m,n).
*
******************************************************************************
*
* @return
* \retval MORSE_SUCCESS successful exit
*
*****************************************************************************/
int MORSE_Desc_Create_OOC(MORSE_desc_t **desc, MORSE_enum dtyp, int mb, int nb, int bsiz,
int lm, int ln, int i, int j, int m, int n, int p, int q,
int (*get_rankof)( const MORSE_desc_t*, int, int ))
{
#if !defined (CHAMELEON_SCHED_STARPU)
morse_error("MORSE_Desc_Create_Tiles", "Only StarPU supports on-demand tile allocation");
return MORSE_ERR_NOT_INITIALIZED;
#else
MORSE_context_t *morse;
int status;
morse = morse_context_self();
if (morse == NULL) {
morse_error("MORSE_Desc_Create_Tiles", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
}
/* Allocate memory and initialize the descriptor */
*desc = (MORSE_desc_t*)malloc(sizeof(MORSE_desc_t));
if (*desc == NULL) {
morse_error("MORSE_Desc_Create_Tiles", "malloc() failed");
return MORSE_ERR_OUT_OF_RESOURCES;
}
**desc = morse_desc_init_user(dtyp, mb, nb, bsiz, lm, ln, i, j, m, n, p, q,
morse_getaddr_null, NULL, get_rankof);
/* memory of the matrix is completely handled by runtime */
(**desc).use_mat = 0;
(**desc).alloc_mat = 0;
(**desc).mat = NULL;
(**desc).ooc = 1;
/* Create scheduler structure like registering data */
RUNTIME_desc_create( *desc );
status = morse_desc_check(*desc);
if (status != MORSE_SUCCESS) {
morse_error("MORSE_Desc_Create_Tiles", "invalid descriptor");
return status;
}
return MORSE_SUCCESS;
#endif
}
/** ***************************************************************************
*
* @ingroup Descriptor
Loading