Commit fd64842a authored by Mathieu Faverge's avatar Mathieu Faverge

morse_ functions are internal functions, they should not be used in user program

parent e49b76d4
......@@ -89,7 +89,10 @@ int main(int argc, char *argv[]) {
print_header( argv[0], iparam);
/* Initialize MORSE with main parameters */
MORSE_Init( NCPU, NGPU );
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
}
/*
* allocate memory for our data using a C macro (see step1.h)
......
......@@ -54,10 +54,6 @@ int main(int argc, char *argv[]) {
double anorm, bnorm, xnorm, eps, res;
int hres;
/* Morse structure containing parameters and a structure to interact with
* the Runtime system */
MORSE_context_t *morse;
/* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF];
memset(iparam, 0, IPARAM_SIZEOF*sizeof(int));
......@@ -87,6 +83,15 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
}
/* Question morse to get the block (tile) size (number of columns) */
MORSE_Get( MORSE_TILE_SIZE, &NB );
/*
* Allocate memory for our data using a C macro (see step2.h)
* - matrix A : size N x N
......@@ -98,18 +103,6 @@ int main(int argc, char *argv[]) {
PASTE_CODE_ALLOCATE_MATRIX( X, double, N, NRHS );
PASTE_CODE_ALLOCATE_MATRIX( Acpy, double, N, N );
/* initialize MORSE with main parameters */
MORSE_Init( NCPU, NGPU );
morse = morse_context_self();
if (morse == NULL) {
morse_fatal_error("step2", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
}
/* question morse to get the block (tile) size (number of columns) */
NB = morse->nb;
/*
* Initialize the structure required for MORSE tile interface
* MORSE_desc_t is a structure wrapping your data allowing MORSE to get
......
......@@ -55,10 +55,6 @@ int main(int argc, char *argv[]) {
double anorm, bnorm, xnorm, eps, res;
int hres;
/* Morse structure containing parameters and a structure to interact with
* the Runtime system */
MORSE_context_t *morse;
/* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF];
memset(iparam, 0, IPARAM_SIZEOF*sizeof(int));
......@@ -88,17 +84,14 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* initialize MORSE with main parameters */
MORSE_Init( NCPU, NGPU );
morse = morse_context_self();
if (morse == NULL) {
morse_fatal_error("step3", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
}
/* question morse to get the block (tile) size (number of columns) */
NB = morse->nb;;
/* Question morse to get the block (tile) size (number of columns) */
MORSE_Get( MORSE_TILE_SIZE, &NB );
/* allocate tile data */
matA = allocate_tile_matrix(N, N, NB);
......
......@@ -56,9 +56,6 @@ int main(int argc, char *argv[]) {
double anorm, bnorm, xnorm, eps, res;
int hres;
/* Morse structure containing parameters and a structure to interact with
* the Runtime system */
MORSE_context_t *morse;
/* MORSE sequence uniquely identifies a set of asynchronous function calls
* sharing common exception handling */
MORSE_sequence_t *sequence = NULL;
......@@ -95,17 +92,14 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* initialize MORSE with main parameters */
MORSE_Init( NCPU, NGPU );
morse = morse_context_self();
if (morse == NULL) {
morse_fatal_error("step4", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
}
/* question morse to get the block (tile) size (number of columns) */
NB = morse->nb;
/* Question morse to get the block (tile) size (number of columns) */
MORSE_Get( MORSE_TILE_SIZE, &NB );
/* Initialize the structure required for MORSE tile interface */
MORSE_Desc_Create(&descA, NULL, MorseRealDouble,
......@@ -136,7 +130,7 @@ int main(int argc, char *argv[]) {
cpu_time = -cWtime();
morse_sequence_create(morse, &sequence);
MORSE_Sequence_Create(&sequence);
/* Cholesky factorization:
* A is replaced by its factorization L or L^T depending on uplo */
......@@ -157,7 +151,7 @@ int main(int argc, char *argv[]) {
RUNTIME_desc_getoncpu(descX);
status = sequence->status;
morse_sequence_destroy(morse, sequence);
MORSE_Sequence_Destroy(sequence);
cpu_time += cWtime();
......
......@@ -4,7 +4,7 @@
* of Tennessee Research Foundation.
* All rights reserved.
* @copyright (c) 2012-2014 Inria. All rights reserved.
* @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
* @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
......@@ -56,9 +56,6 @@ int main(int argc, char *argv[]) {
double anorm, bnorm, xnorm, eps, res;
int hres;
/* Morse structure containing parameters and a structure to interact with
* the Runtime system */
MORSE_context_t *morse;
/* MORSE sequence uniquely identifies a set of asynchronous function calls
* sharing common exception handling */
MORSE_sequence_t *sequence = NULL;
......@@ -98,13 +95,10 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* initialize MORSE with main parameters */
MORSE_Init( NCPU, NGPU );
morse = morse_context_self();
if (morse == NULL) {
morse_fatal_error("step5", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
}
/* set some specific parameters related to MORSE: blocks size and inner-blocking size */
......@@ -140,7 +134,7 @@ int main(int argc, char *argv[]) {
cpu_time = -cWtime();
morse_sequence_create(morse, &sequence);
MORSE_Sequence_Create(&sequence);
/* Cholesky factorization:
* A is replaced by its factorization L or L^T depending on uplo */
......@@ -161,7 +155,7 @@ int main(int argc, char *argv[]) {
RUNTIME_desc_getoncpu(descX);
status = sequence->status;
morse_sequence_destroy(morse, sequence);
MORSE_Sequence_Destroy(sequence);
cpu_time += cWtime();
......
......@@ -57,9 +57,6 @@ int main(int argc, char *argv[]) {
double anorm, bnorm, xnorm, eps, res;
int hres;
/* Morse structure containing parameters and a structure to interact with
* the Runtime system */
MORSE_context_t *morse;
/* MORSE sequence uniquely identifies a set of asynchronous function calls
* sharing common exception handling */
MORSE_sequence_t *sequence = NULL;
......@@ -74,9 +71,9 @@ int main(int argc, char *argv[]) {
/* read arguments */
read_args(argc, argv, iparam);
N = iparam[IPARAM_N];
NB = iparam[IPARAM_NB];
NRHS = iparam[IPARAM_NRHS];
N = iparam[IPARAM_N];
NB = iparam[IPARAM_NB];
NRHS = iparam[IPARAM_NRHS];
/* compute the algorithm complexity to evaluate performances */
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
......@@ -96,13 +93,10 @@ int main(int argc, char *argv[]) {
NCPU = iparam[IPARAM_THRDNBR];
NGPU = iparam[IPARAM_NCUDAS];
/* initialize MORSE with main parameters */
MORSE_Init( NCPU, NGPU );
morse = morse_context_self();
if (morse == NULL) {
morse_fatal_error("step6", "MORSE not initialized");
return MORSE_ERR_NOT_INITIALIZED;
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
}
/* set some specific parameters related to MORSE: blocks size and inner-blocking size */
......@@ -162,7 +156,7 @@ int main(int argc, char *argv[]) {
cpu_time = -cWtime();
morse_sequence_create(morse, &sequence);
MORSE_Sequence_Create(&sequence);
/* Cholesky factorization:
* A is replaced by its factorization L or L^T depending on uplo */
......@@ -183,7 +177,7 @@ int main(int argc, char *argv[]) {
RUNTIME_desc_getoncpu(descX);
status = sequence->status;
morse_sequence_destroy(morse, sequence);
MORSE_Sequence_Destroy(sequence);
cpu_time += cWtime();
......
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