Skip to content

Commit

Permalink
Commented out (potentially) unused files; Does not compile yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyeli committed Mar 19, 2024
1 parent 3855ff5 commit a71306f
Show file tree
Hide file tree
Showing 33 changed files with 324 additions and 294 deletions.
36 changes: 15 additions & 21 deletions EXAMPLE/pddrive.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ int main(int argc, char *argv[])
//MPI_Init( &argc, &argv );
MPI_Init_thread( &argc, &argv, MPI_THREAD_MULTIPLE, &omp_mpi_level);


#if ( VAMPIR>=1 )
VT_traceoff();
#endif

#if ( VTUNE>=1 )
__itt_pause();
#endif

/* Set the default input options:
options.Fact = DOFACT;
options.Equil = YES;
Expand All @@ -115,16 +116,11 @@ int main(int argc, char *argv[])
options.DiagInv = NO;
*/
set_default_options_dist(&options);
options.ReplaceTinyPivot = YES;
options.IterRefine = NOREFINE;
options.DiagInv = YES;
#if 0
options.ParSymbFact = YES;
options.ColPerm = PARMETIS;
options.RowPerm = LargeDiag_HWPM;
options.IterRefine = NOREFINE;
options.ColPerm = NATURAL;
options.Equil = NO;
options.Equil = NO;
options.ReplaceTinyPivot = YES;
#endif

Expand Down Expand Up @@ -178,6 +174,8 @@ int main(int argc, char *argv[])
if (ir != -1) options.IterRefine = ir;
if (symbfact != -1) options.ParSymbFact = symbfact;

int superlu_acc_offload = sp_ienv_dist(10, &options); //get_acc_offload();

/* In the batch mode: create multiple SuperLU grids,
each grid solving one linear system. */
if ( batch ) {
Expand All @@ -187,7 +185,7 @@ int main(int argc, char *argv[])
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
usermap = SUPERLU_MALLOC(nprow*npcol * sizeof(int));
ldumap = nprow;

/* Assuming each grid uses the same number of nprow and npcol */
int color = myrank/(nprow*npcol);
MPI_Comm_split(MPI_COMM_WORLD, color, myrank, &SubComm);
Expand All @@ -196,9 +194,8 @@ int main(int argc, char *argv[])
for (int j = 0; j < npcol; ++j) usermap[i+j*ldumap] = p++;
superlu_gridmap(SubComm, nprow, npcol, usermap, ldumap, &grid);
SUPERLU_FREE(usermap);

#ifdef GPU_ACC
int superlu_acc_offload = get_acc_offload();
if (superlu_acc_offload) {
/* Binding each MPI to a GPU device */
char *ttemp;
Expand All @@ -211,12 +208,12 @@ int main(int argc, char *argv[])
gpuSetDevice(rank % devs); // Set device to be used for GPU executions
}

// This is to initialize GPU, which can be costly.
double t1 = SuperLU_timer_();
// This is to initialize GPU, which can be costly.
double t1 = SuperLU_timer_();
gpuFree(0);
double t2 = SuperLU_timer_();
double t2 = SuperLU_timer_();
if(!myrank)printf("first gpufree time: %7.4f\n",t2-t1);
gpublasHandle_t hb;
gpublasHandle_t hb;
gpublasCreate(&hb);
if(!myrank)printf("first blas create time: %7.4f\n",SuperLU_timer_()-t2);
gpublasDestroy(hb);
Expand All @@ -229,19 +226,16 @@ int main(int argc, char *argv[])
/* ------------------------------------------------------------
INITIALIZE THE SUPERLU PROCESS GRID.
------------------------------------------------------------ */
// nv_init_wrapper(grid.comm);

superlu_gridinit(MPI_COMM_WORLD, nprow, npcol, &grid);

#ifdef GPU_ACC
int superlu_acc_offload = get_acc_offload();
if (superlu_acc_offload) {
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
double t1 = SuperLU_timer_();
double t1 = SuperLU_timer_();
gpuFree(0);
double t2 = SuperLU_timer_();
double t2 = SuperLU_timer_();
if(!myrank)printf("first gpufree time: %7.4f\n",t2-t1);
gpublasHandle_t hb;
gpublasHandle_t hb;
gpublasCreate(&hb);
if(!myrank)printf("first blas create time: %7.4f\n",SuperLU_timer_()-t2);
gpublasDestroy(hb);
Expand Down Expand Up @@ -294,7 +288,7 @@ int main(int argc, char *argv[])
print_options_dist(&options);
fflush(stdout);
}

#if ( VAMPIR>=1 )
VT_traceoff();
#endif
Expand Down
112 changes: 57 additions & 55 deletions EXAMPLE/pddrive3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ int main (int argc, char *argv[])
}
}

/* ------------------------------------------------------------
INITIALIZE THE SUPERLU PROCESS GRID.
------------------------------------------------------------ */
superlu_gridinit3d (MPI_COMM_WORLD, nprow, npcol, npdep, &grid);
iam = grid.iam;

#if ( DEBUGlevel>=1 )
CHECK_MALLOC (iam, "Enter main()");
#endif


/* Parse command line argv[]. */
for (cpp = argv + 1; *cpp; ++cpp)
{
Expand Down Expand Up @@ -205,12 +216,53 @@ int main (int argc, char *argv[])
}
}

/* ------------------------------------------------------------
INITIALIZE THE SUPERLU PROCESS GRID.
------------------------------------------------------------ */
superlu_gridinit3d (MPI_COMM_WORLD, nprow, npcol, npdep, &grid);
/* Set the default input options:
options.Fact = DOFACT;
options.Equil = YES;
options.ParSymbFact = NO;
options.ColPerm = METIS_AT_PLUS_A;
options.RowPerm = LargeDiag_MC64;
options.ReplaceTinyPivot = NO;
options.IterRefine = SLU_DOUBLE;
options.Trans = NOTRANS;
options.SolveInitialized = NO;
options.RefineInitialized = NO;
options.PrintStat = YES;
options->num_lookaheads = 10;
options->lookahead_etree = NO;
options->SymPattern = NO;
options.DiagInv = NO;
*/
set_default_options_dist (&options);
options.Algo3d = YES;
options.IterRefine = NOREFINE;
// options.ParSymbFact = YES;
// options.ColPerm = PARMETIS;
#if 0
options.DiagInv = YES; // only if SLU_HAVE_LAPACK
options.ReplaceTinyPivot = YES;
options.RowPerm = NOROWPERM;
options.ColPerm = NATURAL;
options.ReplaceTinyPivot = YES;
#endif

if ( batchCount > 0 )
options.batchCount = batchCount;

if (equil != -1) options.Equil = equil;
if (rowperm != -1) options.RowPerm = rowperm;
if (colperm != -1) options.ColPerm = colperm;
if (ir != -1) options.IterRefine = ir;
if (lookahead != -1) options.num_lookaheads = lookahead;

if (!iam) {
print_sp_ienv_dist(&options);
print_options_dist(&options);
fflush(stdout);
}

#ifdef GPU_ACC
int superlu_acc_offload = get_acc_offload();
int superlu_acc_offload = sp_ienv_dist(10, &options); //get_acc_offload();
if (superlu_acc_offload) {
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
double t1 = SuperLU_timer_();
Expand Down Expand Up @@ -247,7 +299,6 @@ int main (int argc, char *argv[])
}

/* Bail out if I do not belong in the grid. */
iam = grid.iam;
if (iam == -1) goto out;
if (!iam) {
int v_major, v_minor, v_bugfix;
Expand All @@ -265,55 +316,6 @@ int main (int argc, char *argv[])
fflush(stdout);
}

#if ( DEBUGlevel>=1 )
CHECK_MALLOC (iam, "Enter main()");
#endif

/* Set the default input options:
options.Fact = DOFACT;
options.Equil = YES;
options.ParSymbFact = NO;
options.ColPerm = METIS_AT_PLUS_A;
options.RowPerm = LargeDiag_MC64;
options.ReplaceTinyPivot = NO;
options.IterRefine = SLU_DOUBLE;
options.Trans = NOTRANS;
options.SolveInitialized = NO;
options.RefineInitialized = NO;
options.PrintStat = YES;
options->num_lookaheads = 10;
options->lookahead_etree = NO;
options->SymPattern = NO;
options.DiagInv = NO;
*/
set_default_options_dist (&options);
options.Algo3d = YES;
options.IterRefine = NOREFINE;
// options.ParSymbFact = YES;
// options.ColPerm = PARMETIS;
#if 0
options.DiagInv = YES; // only if SLU_HAVE_LAPACK
options.ReplaceTinyPivot = YES;
options.RowPerm = NOROWPERM;
options.ColPerm = NATURAL;
options.ReplaceTinyPivot = YES;
#endif

if ( batchCount > 0 )
options.batchCount = batchCount;

if (equil != -1) options.Equil = equil;
if (rowperm != -1) options.RowPerm = rowperm;
if (colperm != -1) options.ColPerm = colperm;
if (ir != -1) options.IterRefine = ir;
if (lookahead != -1) options.num_lookaheads = lookahead;

if (!iam) {
print_sp_ienv_dist(&options);
print_options_dist(&options);
fflush(stdout);
}

/* ------------------------------------------------------------
GET THE MATRIX FROM FILE AND SETUP THE RIGHT HAND SIDE.
------------------------------------------------------------ */
Expand Down
4 changes: 2 additions & 2 deletions EXAMPLE/psdrive.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ int main(int argc, char *argv[])
if (ir != -1) options.IterRefine = ir;
if (symbfact != -1) options.ParSymbFact = symbfact;

int superlu_acc_offload = sp_ienv_dist(10, &options); //get_acc_offload();

/* In the batch mode: create multiple SuperLU grids,
each grid solving one linear system. */
if ( batch ) {
Expand All @@ -195,7 +197,6 @@ int main(int argc, char *argv[])
SUPERLU_FREE(usermap);

#ifdef GPU_ACC
int superlu_acc_offload = get_acc_offload();
if (superlu_acc_offload) {
/* Binding each MPI to a GPU device */
char *ttemp;
Expand Down Expand Up @@ -229,7 +230,6 @@ int main(int argc, char *argv[])
superlu_gridinit(MPI_COMM_WORLD, nprow, npcol, &grid);

#ifdef GPU_ACC
int superlu_acc_offload = get_acc_offload();
if (superlu_acc_offload) {
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
double t1 = SuperLU_timer_();
Expand Down
Loading

0 comments on commit a71306f

Please sign in to comment.