Commit cec2cabb authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Keep replacing PASTIX_FOPEN by functions

parent b4c37629
......@@ -70,7 +70,8 @@ void coeftab_zgetschur ( const SolverMatrix *solvmtx,
void coeftab_zdumpcblk( const SolverCblk *cblk,
pastix_uplo_t uplo,
FILE *stream );
void coeftab_zdump ( const SolverMatrix *solvmtx,
void coeftab_zdump ( pastix_data_t *pastix_data,
const SolverMatrix *solvmtx,
const char *filename );
int coeftab_zdiff ( const SolverMatrix *solvA,
SolverMatrix *solvB );
......
......@@ -153,7 +153,7 @@ coeftab_zdumpcblk( const SolverCblk *cblk,
/**
*******************************************************************************
*
* @brief Dump the sovler matrix coefficients into a file in human readable
* @brief Dump the solver matrix coefficients into a file in human readable
* format.
*
* All non-zeroes coefficients are dumped in the format:
......@@ -162,6 +162,10 @@ coeftab_zdumpcblk( const SolverCblk *cblk,
*
*******************************************************************************
*
* @param[inout] pastix_data
* The pastix_data instance to access the unique directory id in which
* output the files.
*
* @param[in] solvmtx
* The solver matrix to print.
*
......@@ -170,14 +174,18 @@ coeftab_zdumpcblk( const SolverCblk *cblk,
*
*******************************************************************************/
void
coeftab_zdump( const SolverMatrix *solvmtx,
const char *filename )
coeftab_zdump( pastix_data_t *pastix_data,
const SolverMatrix *solvmtx,
const char *filename )
{
SolverCblk *cblk = solvmtx->cblktab;
pastix_int_t itercblk;
FILE *stream;
FILE *stream = NULL;
PASTIX_FOPEN( stream, filename, "w" );
stream = pastix_fopenw( pastix_data, filename, "w" );
if ( stream == NULL ){
return;
}
/*
* TODO: there is a problem right here for now, because there are no
......
......@@ -396,10 +396,6 @@ parsec_zgetrf( pastix_data_t *pastix_data,
sopalin_data );
}
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( sopalin_data->solvmtx, "getrf.txt" );
#endif
return;
}
......
......@@ -401,10 +401,6 @@ parsec_zpotrf( pastix_data_t *pastix_data,
sopalin_data );
}
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( sopalin_data->solvmtx, "potrf.txt" );
#endif
return;
}
......
......@@ -376,14 +376,15 @@ pastix_subtask_sopalin( pastix_data_t *pastix_data )
solverBackupRestore( pastix_data->solvmatr, sbackup );
solverBackupExit( sbackup );
#if defined(PASTIX_SYMBOL_DUMP_SYMBMTX)
#if defined(PASTIX_NUMFACT_DUMP_SOLVER)
{
FILE *stream;
PASTIX_FOPEN(stream, "symbol.eps", "w");
solverDraw(pastix_data->solvmatr,
stream,
iparm[IPARM_VERBOSE]);
fclose(stream);
FILE *stream = NULL;
stream = pastix_fopenw( pastix_data, "solver.eps", "w" );
if ( stream ) {
solverDraw( pastix_data->solvmatr,
stream, iparm[IPARM_VERBOSE] );
fclose(stream);
}
}
#endif
......
......@@ -53,10 +53,6 @@ sequential_zgetrf( pastix_data_t *pastix_data,
cpucblk_zgetrfsp1d( datacode, cblk, threshold, work );
}
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( datacode, "getrf_L.txt" );
#endif
memFree_null( work );
}
......@@ -92,14 +88,6 @@ thread_pzgetrf( isched_thread_t *ctx, void *args )
cpucblk_zgetrfsp1d( datacode, cblk, sopalin_data->diagthreshold, work );
}
#if defined(PASTIX_DEBUG_FACTO) && 0
isched_barrier_wait( &(ctx->global_ctx->barrier) );
if (rank == 0) {
coeftab_zdump( datacode, "getrf_L.txt" );
}
isched_barrier_wait( &(ctx->global_ctx->barrier) );
#endif
memFree_null( work );
}
......@@ -136,4 +124,8 @@ sopalin_zgetrf( pastix_data_t *pastix_data,
zgetrf = thread_zgetrf;
}
zgetrf( pastix_data, sopalin_data );
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( pastix_data, sopalin_data->solvmtx, "getrf.txt" );
#endif
}
......@@ -63,10 +63,6 @@ sequential_zhetrf( pastix_data_t *pastix_data,
work1 - (N*N), work2 );
}
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( datacode, "hetrf_L.txt" );
#endif
memFree_null( work1 );
memFree_null( work2 );
}
......@@ -114,14 +110,6 @@ thread_pzhetrf( isched_thread_t *ctx, void *args )
work1 - (N*N), work2 );
}
#if defined(PASTIX_DEBUG_FACTO) && 0
isched_barrier_wait( &(ctx->global_ctx->barrier) );
if (rank == 0) {
coeftab_zdump( datacode, "hetrf_L.txt" );
}
isched_barrier_wait( &(ctx->global_ctx->barrier) );
#endif
memFree_null( work1 );
memFree_null( work2 );
}
......@@ -174,4 +162,8 @@ sopalin_zhetrf( pastix_data_t *pastix_data,
zhetrf = thread_zhetrf;
}
zhetrf( pastix_data, sopalin_data );
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( pastix_data, sopalin_data->solvmtx, "hetrf.txt" );
#endif
}
......@@ -53,10 +53,6 @@ sequential_zpotrf( pastix_data_t *pastix_data,
cpucblk_zpotrfsp1d( datacode, cblk, threshold, work );
}
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( datacode, "potrf_L.txt" );
#endif
memFree_null( work );
}
......@@ -92,14 +88,6 @@ thread_pzpotrf( isched_thread_t *ctx, void *args )
cpucblk_zpotrfsp1d( datacode, cblk, sopalin_data->diagthreshold, work );
}
#if defined(PASTIX_DEBUG_FACTO) && 0
isched_barrier_wait( &(ctx->global_ctx->barrier) );
if (rank == 0) {
coeftab_zdump( datacode, "potrf_L.txt" );
}
isched_barrier_wait( &(ctx->global_ctx->barrier) );
#endif
memFree_null( work );
}
......@@ -136,4 +124,8 @@ sopalin_zpotrf( pastix_data_t *pastix_data,
zpotrf = thread_zpotrf;
}
zpotrf( pastix_data, sopalin_data );
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( pastix_data, sopalin_data->solvmtx, "potrf.txt" );
#endif
}
......@@ -63,10 +63,6 @@ sequential_zsytrf( pastix_data_t *pastix_data,
work1 - (N*N), work2 );
}
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( datacode, "sytrf_L.txt" );
#endif
memFree_null( work1 );
memFree_null( work2 );
}
......@@ -114,14 +110,6 @@ thread_pzsytrf( isched_thread_t *ctx, void *args )
work1 - (N*N), work2 );
}
#if defined(PASTIX_DEBUG_FACTO) && 0
isched_barrier_wait( &(ctx->global_ctx->barrier) );
if (rank == 0) {
coeftab_zdump( datacode, "sytrf_L.txt" );
}
isched_barrier_wait( &(ctx->global_ctx->barrier) );
#endif
memFree_null( work1 );
memFree_null( work2 );
}
......@@ -174,4 +162,8 @@ sopalin_zsytrf( pastix_data_t *pastix_data,
zsytrf = thread_zsytrf;
}
zsytrf( pastix_data, sopalin_data );
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( pastix_data, sopalin_data->solvmtx, "sytrf.txt" );
#endif
}
......@@ -23,11 +23,6 @@ struct sopalin_data_s {
};
typedef struct sopalin_data_s sopalin_data_t;
void coeftab_zdump( const SolverMatrix *solvmtx, const char *filename );
void coeftab_cdump( const SolverMatrix *solvmtx, const char *filename );
void coeftab_ddump( const SolverMatrix *solvmtx, const char *filename );
void coeftab_sdump( const SolverMatrix *solvmtx, const char *filename );
void sopalin_ztrsm( pastix_data_t *pastix_data, int side, int uplo, int trans, int diag, sopalin_data_t *sopalin_data, int nrhs, pastix_complex64_t *b, int ldb );
void sopalin_ctrsm( pastix_data_t *pastix_data, int side, int uplo, int trans, int diag, sopalin_data_t *sopalin_data, int nrhs, pastix_complex32_t *b, int ldb );
void sopalin_dtrsm( pastix_data_t *pastix_data, int side, int uplo, int trans, int diag, sopalin_data_t *sopalin_data, int nrhs, double *b, int ldb );
......
......@@ -326,10 +326,6 @@ starpu_zgetrf( pastix_data_t *pastix_data,
starpu_mpi_barrier(MPI_COMM_WORLD);
#endif
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( sopalin_data->solvmtx, "getrf.txt" );
#endif
return;
}
......
......@@ -285,10 +285,6 @@ starpu_zpotrf( pastix_data_t *pastix_data,
starpu_mpi_barrier(MPI_COMM_WORLD);
#endif
#if defined(PASTIX_DEBUG_FACTO)
coeftab_zdump( sopalin_data->solvmtx, "potrf.txt" );
#endif
return;
}
......
......@@ -172,10 +172,12 @@ pastix_subtask_symbfact( pastix_data_t *pastix_data )
/*Symbol matrix loaded from file */
if ( iparm[IPARM_IO_STRATEGY] & PastixIOLoad )
{
FILE *stream;
PASTIX_FOPEN(stream, "symbname", "r" );
symbolLoad( pastix_data->symbmtx, stream );
fclose(stream);
FILE *stream = NULL;
stream = pastix_fopen( "symbname", "r" );
if ( stream ) {
symbolLoad( pastix_data->symbmtx, stream );
fclose(stream);
}
}
/* Symbol matrix computed through Fax or Kass */
else
......@@ -364,10 +366,12 @@ pastix_subtask_symbfact( pastix_data_t *pastix_data )
if ( iparm[IPARM_IO_STRATEGY] & PastixIOSave )
{
if (procnum == 0) {
FILE *stream;
PASTIX_FOPEN(stream, "symbgen", "w");
symbolSave(pastix_data->symbmtx, stream);
fclose(stream);
FILE *stream = NULL;
stream = pastix_fopenw( pastix_data, "symbgen", "w" );
if ( stream ) {
symbolSave( pastix_data->symbmtx, stream );
fclose(stream);
}
}
}
......@@ -377,11 +381,14 @@ pastix_subtask_symbfact( pastix_data_t *pastix_data )
#if defined(PASTIX_SYMBOL_DUMP_SYMBMTX)
if (procnum == 0)
{
FILE *stream;
PASTIX_FOPEN(stream, "symbol.eps", "w");
symbolDraw(pastix_data->symbmtx,
stream);
fclose(stream);
FILE *stream = NULL;
stream = pastix_fopenw( pastix_data, "symbol.eps", "w" );
if ( stream ) {
symbolDraw( pastix_data,
pastix_data->symbmtx,
stream );
fclose(stream);
}
}
#endif
......
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