Skip to content

Commit

Permalink
Fix a logic issue: when reusing L&U structure, always call pxdistribu…
Browse files Browse the repository at this point in the history
…te() to distribute A even if in the case of parallel symbolic.
  • Loading branch information
xiaoyeli committed Jan 27, 2025
1 parent 26ee4df commit d2f0f1e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
10 changes: 6 additions & 4 deletions SRC/complex16/pzgssvx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,10 @@ pzgssvx(superlu_dist_options_t *options, SuperMatrix *A,
if (symb_comm != MPI_COMM_NULL) MPI_Comm_free (&symb_comm);

/* Distribute entries of A into L & U data structures. */
//if (parSymbFact == NO || ???? Fact == SamePattern_SameRowPerm) {
if ( parSymbFact == NO ) {
/* CASE OF SERIAL SYMBOLIC */
if (parSymbFact == NO || Fact == SamePattern_SameRowPerm) {
//if ( parSymbFact == NO ) {
/* Case of serial symbolic,
or parallel symbolic and reuse L&U structure, only redistribute A */
/* Apply column permutation to the original distributed A */
for (j = 0; j < nnz_loc; ++j) colind[j] = perm_c[colind[j]];

Expand Down Expand Up @@ -1390,7 +1391,7 @@ pzgssvx(superlu_dist_options_t *options, SuperMatrix *A,



/* nvshmem related. */
/* nvshmem related */
#ifdef HAVE_NVSHMEM
nsupers = Glu_persist->supno[n-1] + 1;
int nc = CEILING( nsupers, grid->npcol);
Expand All @@ -1405,6 +1406,7 @@ pzgssvx(superlu_dist_options_t *options, SuperMatrix *A,
if (get_acc_solve()){
nv_init_wrapper(grid->comm);
zprepare_multiGPU_buffers(flag_bc_size,flag_rd_size,ready_x_size,ready_lsum_size,my_flag_bc_size,my_flag_rd_size);

}
#endif

Expand Down
13 changes: 8 additions & 5 deletions SRC/double/pdgssvx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,10 @@ pdgssvx(superlu_dist_options_t *options, SuperMatrix *A,
if (symb_comm != MPI_COMM_NULL) MPI_Comm_free (&symb_comm);

/* Distribute entries of A into L & U data structures. */
//if (parSymbFact == NO || ???? Fact == SamePattern_SameRowPerm) {
if ( parSymbFact == NO ) {
/* CASE OF SERIAL SYMBOLIC */
if (parSymbFact == NO || Fact == SamePattern_SameRowPerm) {
//if ( parSymbFact == NO ) {
/* Case of serial symbolic,
or parallel symbolic and reuse L&U structure, only redistribute A */
/* Apply column permutation to the original distributed A */
for (j = 0; j < nnz_loc; ++j) colind[j] = perm_c[colind[j]];

Expand Down Expand Up @@ -1165,6 +1166,7 @@ pdgssvx(superlu_dist_options_t *options, SuperMatrix *A,

/*if (!iam) printf ("\tDISTRIBUTE time %8.2f\n", stat->utime[DIST]);*/


/* Perform numerical factorization in parallel. */
t = SuperLU_timer_();
// #pragma omp parallel
Expand Down Expand Up @@ -1384,7 +1386,7 @@ pdgssvx(superlu_dist_options_t *options, SuperMatrix *A,



/* nvshmem related. */
/* nvshmem related */
#ifdef HAVE_NVSHMEM
nsupers = Glu_persist->supno[n-1] + 1;
int nc = CEILING( nsupers, grid->npcol);
Expand All @@ -1397,8 +1399,9 @@ pdgssvx(superlu_dist_options_t *options, SuperMatrix *A,
int ready_x_size = maxrecvsz*nc;
int ready_lsum_size = 2*maxrecvsz*nr;
if (get_acc_solve()){
nv_init_wrapper(grid->comm);
nv_init_wrapper(grid->comm);
dprepare_multiGPU_buffers(flag_bc_size,flag_rd_size,ready_x_size,ready_lsum_size,my_flag_bc_size,my_flag_rd_size);

}
#endif

Expand Down
11 changes: 6 additions & 5 deletions SRC/single/psgssvx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,10 @@ psgssvx(superlu_dist_options_t *options, SuperMatrix *A,
if (symb_comm != MPI_COMM_NULL) MPI_Comm_free (&symb_comm);

/* Distribute entries of A into L & U data structures. */
//if (parSymbFact == NO || ???? Fact == SamePattern_SameRowPerm) {
if ( parSymbFact == NO ) {
/* CASE OF SERIAL SYMBOLIC */
if (parSymbFact == NO || Fact == SamePattern_SameRowPerm) {
//if ( parSymbFact == NO ) {
/* Case of serial symbolic,
or parallel symbolic and reuse L&U structure, only redistribute A */
/* Apply column permutation to the original distributed A */
for (j = 0; j < nnz_loc; ++j) colind[j] = perm_c[colind[j]];

Expand Down Expand Up @@ -1385,7 +1386,7 @@ psgssvx(superlu_dist_options_t *options, SuperMatrix *A,



/* nvshmem related.*/
/* nvshmem related */
#ifdef HAVE_NVSHMEM
nsupers = Glu_persist->supno[n-1] + 1;
int nc = CEILING( nsupers, grid->npcol);
Expand All @@ -1400,10 +1401,10 @@ psgssvx(superlu_dist_options_t *options, SuperMatrix *A,
if (get_acc_solve()){
nv_init_wrapper(grid->comm);
sprepare_multiGPU_buffers(flag_bc_size,flag_rd_size,ready_x_size,ready_lsum_size,my_flag_bc_size,my_flag_rd_size);

}
#endif


} /* end if (!factored) */

if ( options->Fact == DOFACT || options->Fact == SamePattern ) {
Expand Down

0 comments on commit d2f0f1e

Please sign in to comment.