Commit 722857d9 authored by PRUVOST Florent's avatar PRUVOST Florent

MORSE_Desc_Create_User with NULL pointer cannot be used to allocate the data...

MORSE_Desc_Create_User with NULL pointer cannot be used to allocate the data (mat) - when NULL is given to MORSE_Desc_Create_User means that the application manage the allocation - to let MORSE allocate its data -> use MORSE_Desc_Create with NULL pointer
parent 729f9461
......@@ -64,37 +64,25 @@ int main(int argc, char *argv[]) {
* MORSE_desc_t is a structure wrapping your data allowing MORSE to get
* pointers to tiles
*/
MORSE_Desc_Create_User(&descA, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create(&descA, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1);
/* generate A matrix with random values such that it is hermitian */
MORSE_zplghe_Tile( (double)N, descA, 51 );
/* generate RHS */
MORSE_Desc_Create_User(&descB, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, 1, 0, 0, N, 1, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create(&descB, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, 1, 0, 0, N, 1, 1, 1);
MORSE_zplrnt_Tile( descB, 7672 );
/* copy A before facto. in order to check the result */
MORSE_Desc_Create_User(&descAC, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create(&descAC, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1);
MORSE_zlacpy_Tile(MorseUpperLower, descA, descAC);
/* copy B before solving in order to check the result */
MORSE_Desc_Create_User(&descX, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, 1, 0, 0, N, 1, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create(&descX, NULL, MorseComplexDouble,
NB, NB, NB*NB, N, 1, 0, 0, N, 1, 1, 1);
MORSE_zlacpy_Tile(MorseUpperLower, descB, descX);
/* solve the system AX = B using the Cholesky factorization,
......
......@@ -131,21 +131,12 @@ int main(int argc, char *argv[]) {
* is equivalent to a call to MORSE_Desc_Create (morse_get... are the
* functions used inside MORSE_Desc_Create).
*/
MORSE_Desc_Create_User(&descB, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create_User(&descX, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create_User(&descAC, NULL, MorseRealDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create(&descB, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS, 1, 1);
MORSE_Desc_Create(&descX, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS, 1, 1);
MORSE_Desc_Create(&descAC, NULL, MorseRealDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N, 1, 1);
/* generate A matrix with random values such that it is spd */
MORSE_dplgsy_Tile( (double)N, descA, 51 );
......
......@@ -130,30 +130,18 @@ int main(int argc, char *argv[]) {
}
/* Initialize the structure required for MORSE tile interface */
MORSE_Desc_Create_User(&descA, NULL, MorseRealDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N,
GRID_P, GRID_Q,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create_User(&descB, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS,
GRID_P, GRID_Q,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create_User(&descX, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS,
GRID_P, GRID_Q,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create_User(&descAC, NULL, MorseRealDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N,
GRID_P, GRID_Q,
morse_getaddr_ccrb,
morse_getblkldd_ccrb,
morse_getrankof_2d);
MORSE_Desc_Create(&descA, NULL, MorseRealDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N,
GRID_P, GRID_Q);
MORSE_Desc_Create(&descB, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS,
GRID_P, GRID_Q);
MORSE_Desc_Create(&descX, NULL, MorseRealDouble,
NB, NB, NB*NB, N, NRHS, 0, 0, N, NRHS,
GRID_P, GRID_Q);
MORSE_Desc_Create(&descAC, NULL, MorseRealDouble,
NB, NB, NB*NB, N, N, 0, 0, N, N,
GRID_P, GRID_Q);
/* generate A matrix with random values such that it is spd */
MORSE_dplgsy_Tile( (double)N, descA, 51 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment