Skip to content

Commit

Permalink
Rename constant name EMPTY to SLU_EMPTY in util_dist.h, to avoid name…
Browse files Browse the repository at this point in the history
… clash with system defs.
  • Loading branch information
xiaoyeli committed May 3, 2023
1 parent 0954218 commit 09cb143
Show file tree
Hide file tree
Showing 47 changed files with 297 additions and 301 deletions.
4 changes: 2 additions & 2 deletions EXAMPLE/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
include ../make.inc

SEXM = psdrive.o screate_matrix.o dcreate_matrix.o screate_A_x_b.o \
psgssvx_tracking.o psgsrfs_tracking.o \
psutil.o sdistribute.o
psgssvx_tracking.o psgsrfs_tracking.o
# psutil.o sdistribute.o
# psgssvx_d2.o psgsrfs_d2.o sutil_dist.o psgsequb.o

DEXM = pddrive.o dcreate_matrix.o
Expand Down
2 changes: 2 additions & 0 deletions EXAMPLE/pddrive.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ int main(int argc, char *argv[])
*/
set_default_options_dist(&options);
#if 0
options.ParSymbFact = YES;
options.ColPerm = PARMETIS;
options.RowPerm = LargeDiag_HWPM;
options.IterRefine = NOREFINE;
options.ColPerm = NATURAL;
Expand Down
2 changes: 1 addition & 1 deletion SRC/communication_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int_t Wait_LSend
for (int_t pj = 0; pj < Pc; ++pj)
{
/* Wait for Isend to complete before using lsub/lusup. */
if (ToSendR[lk][pj] != EMPTY && pj != mycol)
if (ToSendR[lk][pj] != SLU_EMPTY && pj != mycol)
{
MPI_Wait (&send_req[pj], &status);
MPI_Wait (&send_req[pj + Pc], &status);
Expand Down
4 changes: 2 additions & 2 deletions SRC/dcommunication_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int_t dIBcast_LPanel

for (int_t pj = 0; pj < Pc; ++pj)
{
if (ToSendR[lk][pj] != EMPTY)
if (ToSendR[lk][pj] != SLU_EMPTY)
{


Expand Down Expand Up @@ -89,7 +89,7 @@ int_t dBcast_LPanel

for (int_t pj = 0; pj < Pc; ++pj)
{
if (ToSendR[lk][pj] != EMPTY)
if (ToSendR[lk][pj] != SLU_EMPTY)
{


Expand Down
14 changes: 7 additions & 7 deletions SRC/ddistribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ ddistribute(superlu_dist_options_t *options,

mem_use += (float) k*sizeof(int_t*) + (j + nsupers)*iword;

for (i = 0; i < j; ++i) index1[i] = EMPTY;
for (i = 0; i < j; ++i) index1[i] = SLU_EMPTY;
for (i = 0,j = 0; i < k; ++i, j += grid->npcol) ToSendR[i] = &index1[j];
k = CEILING( nsupers, grid->nprow ); /* Number of local block rows */

Expand Down Expand Up @@ -610,14 +610,14 @@ ddistribute(superlu_dist_options_t *options,
len = k * grid->nprow;
if ( !(index1 = int32Malloc_dist(len)) )
ABORT("Malloc fails for fsendx_plist[0]");
for (i = 0; i < len; ++i) index1[i] = EMPTY;
for (i = 0; i < len; ++i) index1[i] = SLU_EMPTY;
for (i = 0, j = 0; i < k; ++i, j += grid->nprow)
fsendx_plist[i] = &index1[j];
if ( !(bsendx_plist = (int **) SUPERLU_MALLOC(k*sizeof(int*))) )
ABORT("Malloc fails for bsendx_plist[].");
if ( !(index1 = int32Malloc_dist(len)) )
ABORT("Malloc fails for bsendx_plist[0]");
for (i = 0; i < len; ++i) index1[i] = EMPTY;
for (i = 0; i < len; ++i) index1[i] = SLU_EMPTY;
for (i = 0, j = 0; i < k; ++i, j += grid->nprow)
bsendx_plist[i] = &index1[j];

Expand Down Expand Up @@ -675,7 +675,7 @@ ddistribute(superlu_dist_options_t *options,
pr = PROW( gb, grid );
if ( pr != jbrow &&
myrow == jbrow && /* diag. proc. owning jb */
bsendx_plist[ljb][pr] == EMPTY ) {
bsendx_plist[ljb][pr] == SLU_EMPTY ) {
bsendx_plist[ljb][pr] = YES;
++nbsendx;
}
Expand Down Expand Up @@ -742,7 +742,7 @@ ddistribute(superlu_dist_options_t *options,
pr = PROW( gb, grid ); /* Process row owning this block */
if ( pr != jbrow &&
myrow == jbrow && /* diag. proc. owning jb */
fsendx_plist[ljb][pr] == EMPTY /* first time */ ) {
fsendx_plist[ljb][pr] == SLU_EMPTY /* first time */ ) {
fsendx_plist[ljb][pr] = YES;
++nfsendx;
}
Expand Down Expand Up @@ -1313,7 +1313,7 @@ ddistribute(superlu_dist_options_t *options,
if(Root==myrow){
rank_cnt_ref=1;
for (j = 0; j < grid->nprow; ++j) {
if ( fsendx_plist[ljb][j] != EMPTY ) {
if ( fsendx_plist[ljb][j] != SLU_EMPTY ) {
++rank_cnt_ref;
}
}
Expand Down Expand Up @@ -1651,7 +1651,7 @@ if ( !iam) printf(".. Construct Reduce tree for L: %.2f\t\n", t);
for (j = 0; j < grid->nprow; ++j) {
// printf("ljb %5d j %5d nprow %5d\n",ljb,j,grid->nprow);
// fflush(stdout);
if ( bsendx_plist[ljb][j] != EMPTY ) {
if ( bsendx_plist[ljb][j] != SLU_EMPTY ) {
++rank_cnt_ref;
}
}
Expand Down
4 changes: 2 additions & 2 deletions SRC/dlook_ahead_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ while (j < nub && perm_u[2 * j] <= k0 + num_look_aheads)

scp = &grid->rscp; /* The scope of process row. */
for (pj = 0; pj < Pc; ++pj) {
if (ToSendR[lk][pj] != EMPTY) {
if (ToSendR[lk][pj] != SLU_EMPTY) {
#if ( PROFlevel>=1 )
TIC (t1);
#endif
Expand All @@ -271,7 +271,7 @@ while (j < nub && perm_u[2 * j] <= k0 + num_look_aheads)
iam, kk, msgcnt[0], msgcnt[1], pj,
SLU_MPI_TAG(0,kk0), SLU_MPI_TAG(1,kk0));
#endif
} /* end if ( ToSendR[lk][pj] != EMPTY ) */
} /* end if ( ToSendR[lk][pj] != SLU_EMPTY ) */
} /* end for pj ... */
} /* end if( look_ahead[kk] == k0 && kcol == mycol ) */
} /* end while j < nub and perm_u[j] <k0+NUM_LOOK_AHEAD */
Expand Down
16 changes: 8 additions & 8 deletions SRC/dnrformat_loc3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void dGatherNRformat_loc3d
if ( Fact == DOFACT ) { /* Factorize from scratch */
/* A3d is output. Compute counts from scratch */
A3d = SUPERLU_MALLOC(sizeof(NRformat_loc3d));
A3d->num_procs_to_send = EMPTY; // No X(2d) -> X(3d) comm. schedule yet
A3d->num_procs_to_send = SLU_EMPTY; // No X(2d) -> X(3d) comm. schedule yet
A2d = SUPERLU_MALLOC(sizeof(NRformat_loc));

// find number of nnzs
Expand Down Expand Up @@ -364,11 +364,11 @@ int dScatter_B3d(NRformat_loc3d *A3d, // modified
In the most general case, block rows of B are not of even size, then the
Layer 0 partition may overlap with 3D partition in an arbitrary manner.
For example:
P0 P1 P2 P3
P0 P1 P2 P3
X on grid-0: |___________|__________|_________|________|
X on 3D: |___|____|_____|____|__|______|_____|_____|
P0 P1 P2 P3 P4 P5 P6 P7
P0 P1 P2 P3 P4 P5 P6 P7
*/
MPI_Status recv_status;
int pxy = grid2d->nprow * grid2d->npcol;
Expand Down Expand Up @@ -412,14 +412,14 @@ int dScatter_B3d(NRformat_loc3d *A3d, // modified
for (p = 0; p < nprocs; ++p) {
x_send_counts[p] = 0;
x_recv_counts[p] = 0;
procs_to_send_list[p] = EMPTY; // (-1)
procs_recv_from_list[p] = EMPTY;
procs_to_send_list[p] = SLU_EMPTY; // (-1)
procs_recv_from_list[p] = SLU_EMPTY;
}

/* All procs participate */
MPI_Allgather(&(A3d->m_loc), 1, MPI_INT, m_loc_3d_counts, 1,
MPI_INT, grid3d->comm);

/* Layer 0 set up sends info. The other layers have 0 send counts. */
if (grid3d->zscp.Iam == 0) {
int x_fst_row = A2d->fst_row; // start from a layer 0 boundary
Expand Down Expand Up @@ -461,15 +461,15 @@ int dScatter_B3d(NRformat_loc3d *A3d, // modified
x_recv_counts matrix */
MPI_Alltoall(x_send_counts, 1, MPI_INT, x_recv_counts, 1, MPI_INT,
grid3d->comm);

j = 0; // tracking number procs to receive from
for (p = 0; p < nprocs; ++p) {
if (x_recv_counts[p]) {
procs_recv_from_list[j] = p;
recv_count_list[j] = x_recv_counts[p];
src = p; tag = iam;
++j;
#if 0
#if 0
printf("RECV: src %d -> iam %d, x_recv_counts[p] %d, tag %d\n",
src, iam, x_recv_counts[p], tag);
fflush(stdout);
Expand Down
8 changes: 4 additions & 4 deletions SRC/get_perm_c_parmetis.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ a_plus_at_CompRow_loc
THIS COUNTS FOR TWO PASSES OF THE LOCAL ROWS OF A AND T.
------------------------------------------------------------------ */

/* Reset marker to EMPTY */
for (i = 0; i < n; ++i) marker[i] = EMPTY;
/* Reset marker to SLU_EMPTY */
for (i = 0; i < n; ++i) marker[i] = SLU_EMPTY;
/* save rdispls information */
for (p = 0; p < nprocs_i; p++)
sdispls[p] = rdispls[p];
Expand Down Expand Up @@ -654,8 +654,8 @@ a_plus_at_CompRow_loc
if (apat_mem > apat_mem_max)
apat_mem_max = apat_mem;

/* Reset marker to EMPTY */
for (i = 0; i < n; i++) marker[i] = EMPTY;
/* Reset marker to SLU_EMPTY */
for (i = 0; i < n; i++) marker[i] = SLU_EMPTY;
/* restore rdispls information */
for (p = 0; p < nprocs_i; p++)
rdispls[p] = sdispls[p];
Expand Down
14 changes: 7 additions & 7 deletions SRC/pddistribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ pddistribute(superlu_dist_options_t *options, int_t n, SuperMatrix *A,

mem_use += (float) k*sizeof(int_t*) + (j + nsupers)*iword;

for (i = 0; i < j; ++i) index1[i] = EMPTY;
for (i = 0; i < j; ++i) index1[i] = SLU_EMPTY;
for (i = 0,j = 0; i < k; ++i, j += grid->npcol) ToSendR[i] = &index1[j];
k = CEILING( nsupers, grid->nprow ); /* Number of local block rows */

Expand Down Expand Up @@ -924,14 +924,14 @@ pddistribute(superlu_dist_options_t *options, int_t n, SuperMatrix *A,
len = k * grid->nprow;
if ( !(index1 = int32Malloc_dist(len)) )
ABORT("Malloc fails for fsendx_plist[0]");
for (i = 0; i < len; ++i) index1[i] = EMPTY;
for (i = 0; i < len; ++i) index1[i] = SLU_EMPTY;
for (i = 0, j = 0; i < k; ++i, j += grid->nprow)
fsendx_plist[i] = &index1[j];
if ( !(bsendx_plist = (int **) SUPERLU_MALLOC(k*sizeof(int*))) )
ABORT("Malloc fails for bsendx_plist[].");
if ( !(index1 = int32Malloc_dist(len)) )
ABORT("Malloc fails for bsendx_plist[0]");
for (i = 0; i < len; ++i) index1[i] = EMPTY;
for (i = 0; i < len; ++i) index1[i] = SLU_EMPTY;
for (i = 0, j = 0; i < k; ++i, j += grid->nprow)
bsendx_plist[i] = &index1[j];
/* -------------------------------------------------------------- */
Expand Down Expand Up @@ -990,7 +990,7 @@ pddistribute(superlu_dist_options_t *options, int_t n, SuperMatrix *A,
pr = PROW( gb, grid );
if ( pr != jbrow &&
myrow == jbrow && /* diag. proc. owning jb */
bsendx_plist[ljb][pr] == EMPTY ) {
bsendx_plist[ljb][pr] == SLU_EMPTY ) {
bsendx_plist[ljb][pr] = YES;
++nbsendx;
}
Expand Down Expand Up @@ -1056,7 +1056,7 @@ pddistribute(superlu_dist_options_t *options, int_t n, SuperMatrix *A,
pr = PROW( gb, grid ); /* Process row owning this block */
if ( pr != jbrow &&
myrow == jbrow && /* diag. proc. owning jb */
fsendx_plist[ljb][pr] == EMPTY /* first time */ ) {
fsendx_plist[ljb][pr] == SLU_EMPTY /* first time */ ) {
fsendx_plist[ljb][pr] = YES;
++nfsendx;
}
Expand Down Expand Up @@ -1630,7 +1630,7 @@ pddistribute(superlu_dist_options_t *options, int_t n, SuperMatrix *A,
if(Root==myrow){
rank_cnt_ref=1;
for (j = 0; j < grid->nprow; ++j) {
if ( fsendx_plist[ljb][j] != EMPTY ) {
if ( fsendx_plist[ljb][j] != SLU_EMPTY ) {
++rank_cnt_ref;
}
}
Expand Down Expand Up @@ -1974,7 +1974,7 @@ if ( !iam) printf(".. Construct Reduce tree for L: %.2f\t\n", t);
for (j = 0; j < grid->nprow; ++j) {
// printf("ljb %5d j %5d nprow %5d\n",ljb,j,grid->nprow);
// fflush(stdout);
if ( bsendx_plist[ljb][j] != EMPTY ) {
if ( bsendx_plist[ljb][j] != SLU_EMPTY ) {
++rank_cnt_ref;
}
}
Expand Down
4 changes: 2 additions & 2 deletions SRC/pdgsmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ void pdgsmv_init
}

/* Build SPA to aid global to local translation. */
for (i = 0; i < n; ++i) spa[i] = EMPTY;
for (i = 0; i < n; ++i) spa[i] = SLU_EMPTY;
for (i = 0; i < m_loc; ++i) { /* Loop through each row of A */
for (j = rowptr[i]; j < rowptr[i+1]; ++j) {
jcol = colind[j];
if ( spa[jcol] == EMPTY ) { /* First time see this index */
if ( spa[jcol] == SLU_EMPTY ) { /* First time see this index */
p = row_to_proc[jcol];
if ( p == iam ) { /* Local */
/*assert(jcol>=fst_row);*/
Expand Down
8 changes: 4 additions & 4 deletions SRC/pdgstrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ pdgstrf(superlu_dist_options_t * options, int m, int n, double anorm,
}

for (pj = 0; pj < Pc; ++pj) {
if (ToSendR[lk][pj] != EMPTY) {
if (ToSendR[lk][pj] != SLU_EMPTY) {
#if ( PROFlevel>=1 )
TIC (t1);
#endif
Expand Down Expand Up @@ -1155,7 +1155,7 @@ pdgstrf(superlu_dist_options_t * options, int m, int n, double anorm,
}
scp = &grid->rscp; /* The scope of process row. */
for (pj = 0; pj < Pc; ++pj) {
if (ToSendR[lk][pj] != EMPTY) {
if (ToSendR[lk][pj] != SLU_EMPTY) {
lusup1 = Lnzval_bc_ptr[lk];
#if ( PROFlevel>=1 )
TIC (t1);
Expand Down Expand Up @@ -1377,7 +1377,7 @@ pdgstrf(superlu_dist_options_t * options, int m, int n, double anorm,
#endif
for (pj = 0; pj < Pc; ++pj) {
/* Wait for Isend to complete before using lsub/lusup buffer. */
if (ToSendR[lk][pj] != EMPTY) {
if (ToSendR[lk][pj] != SLU_EMPTY) {
MPI_Wait (&send_req[pj], &status);
MPI_Wait (&send_req[pj + Pc], &status);
}
Expand Down Expand Up @@ -1704,7 +1704,7 @@ pdgstrf(superlu_dist_options_t * options, int m, int n, double anorm,

scp = &grid->rscp; /* The scope of process row. */
for (pj = 0; pj < Pc; ++pj) {
if (ToSendR[lk][pj] != EMPTY) {
if (ToSendR[lk][pj] != SLU_EMPTY) {
#if ( PROFlevel>=1 )
TIC (t1);
#endif
Expand Down
8 changes: 4 additions & 4 deletions SRC/pdgstrs1.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void pdgstrs1(superlu_dist_options_t *options, int_t n,
* Send Xk to process column Pc[k].
*/
for (p = 0; p < Pr; ++p)
if ( fsendx_plist[lk][p] != EMPTY ) {
if ( fsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down Expand Up @@ -454,7 +454,7 @@ void pdgstrs1(superlu_dist_options_t *options, int_t n,
*/
kcol = PCOL( k, grid );
for (p = 0; p < Pr; ++p)
if ( fsendx_plist[lk][p] != EMPTY ) {
if ( fsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down Expand Up @@ -764,7 +764,7 @@ void pdgstrs1(superlu_dist_options_t *options, int_t n,
* Send Xk to process column Pc[k].
*/
for (p = 0; p < Pr; ++p)
if ( bsendx_plist[lk][p] != EMPTY ) {
if ( bsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down Expand Up @@ -855,7 +855,7 @@ void pdgstrs1(superlu_dist_options_t *options, int_t n,
*/
kcol = PCOL( k, grid );
for (p = 0; p < Pr; ++p)
if ( bsendx_plist[lk][p] != EMPTY ) {
if ( bsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down
8 changes: 4 additions & 4 deletions SRC/pdgstrs_Bglobal.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pdgstrs_Bglobal(superlu_dist_options_t *options, int_t n,
* Send Xk to process column Pc[k].
*/
for (p = 0; p < Pr; ++p) {
if ( fsendx_plist[lk][p] != EMPTY ) {
if ( fsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down Expand Up @@ -487,7 +487,7 @@ pdgstrs_Bglobal(superlu_dist_options_t *options, int_t n,
*/
kcol = PCOL( k, grid );
for (p = 0; p < Pr; ++p) {
if ( fsendx_plist[lk][p] != EMPTY ) {
if ( fsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down Expand Up @@ -798,7 +798,7 @@ pdgstrs_Bglobal(superlu_dist_options_t *options, int_t n,
* Send Xk to process column Pc[k].
*/
for (p = 0; p < Pr; ++p) {
if ( bsendx_plist[lk][p] != EMPTY ) {
if ( bsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down Expand Up @@ -895,7 +895,7 @@ pdgstrs_Bglobal(superlu_dist_options_t *options, int_t n,
*/
kcol = PCOL( k, grid );
for (p = 0; p < Pr; ++p) {
if ( bsendx_plist[lk][p] != EMPTY ) {
if ( bsendx_plist[lk][p] != SLU_EMPTY ) {
pi = PNUM( p, kcol, grid );
#ifdef ISEND_IRECV
MPI_Isend( &x[ii - XK_H], knsupc * nrhs + XK_H,
Expand Down
Loading

0 comments on commit 09cb143

Please sign in to comment.