Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 13, 2023
1 parent 04f025c commit fbe9982
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions LAGraph/src/algorithm/LG_CC_FastSV6.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions
bool T_jumbled, T_iso ;
GRB_TRY (GxB_Matrix_unpack_CSR (T, &Tp, &Tj, &Tx, &Tp_size, &Tj_size,
&Tx_size, &T_iso, &T_jumbled, NULL)) ;
// printf ("did unpack T\n") ; fflush (stdout) ; fflush (stderr) ;
#pragma omp parallel for num_threads(nthreads) schedule(static)
for (tid = 0 ; tid < nthreads ; tid++)
{
Expand Down Expand Up @@ -601,33 +600,15 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions
count [tid] = p - Tp [range [tid]] ;
}

// printf ("did prune T\n") ; fflush (stdout) ; fflush (stderr) ;

// Compact empty space out of Tj not filled in from the above phase.
nvals = 0 ;
for (tid = 0 ; tid < nthreads ; tid++)
{
// `memcpy` is not safe if src/dest are overlapping.
// Use `memmove` (or if available `memmove_s`) instead.

// #if defined (__STDC_LIB_EXT1__)
// memmove_s (Tj + nvals, Tj_size - sizeof (GrB_Index) * nvals,
// Tj + Tp [range [tid]], sizeof (GrB_Index) * count [tid]) ;
// #else

// memmove is safe: src/dest can overlap, but the copy will not go
// outside of the array, and Tj is never NULL at this point
// (GRB_TRY on the GxB_Matrix_unpack_CSR above would catch that
// condition). So memmove_s isn't necessary.
memmove (Tj + nvals,
Tj + Tp [range [tid]], sizeof (GrB_Index) * count [tid]) ;

// #endif

nvals += count [tid] ;
count [tid] = nvals - count [tid] ;
}
// printf ("did compact T\n") ; fflush (stdout) ; fflush (stderr) ;

// Compact empty space out of Tp
#pragma omp parallel for num_threads(nthreads) schedule(static)
Expand All @@ -640,23 +621,17 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions
}
}

// printf ("did 2nd compact T\n") ; fflush (stdout) ; fflush (stderr) ;

// finalize T
Tp [n] = nvals ;

// pack T for the final phase
GRB_TRY (GxB_Matrix_pack_CSR (T, &Tp, &Tj, &Tx, Tp_size, Tj_size,
Tx_size, T_iso, /* T is now jumbled */ true, NULL)) ;

// printf ("did pack T\n") ; fflush (stdout) ; fflush (stderr) ;

// pack A (unchanged since last unpack); this is the original G->A.
GRB_TRY (GxB_Matrix_pack_CSR (A, &Ap, &Aj, &Ax, Ap_size, Aj_size,
Ax_size, A_iso, A_jumbled, NULL)) ;

// printf ("did pack A\n") ; fflush (stdout) ; fflush (stderr) ;

// ]. The unpack/pack of A into Ap, Aj, Ax will not be needed, and G->A
// will become truly a read-only matrix.

Expand Down

0 comments on commit fbe9982

Please sign in to comment.