8#include "CombBLAS/CombBLAS.h"
46template <
typename PARMAT>
143 int * rdispls =
new int[
nprocs+1];
146 int * sdispls =
new int[
nprocs+1];
151#pragma omp parallel for
176 for(
int i=0; i<
nprocs; ++i)
178 sdispls[i+1] = sdispls[i] +
sendcnt[i];
179 rdispls[i+1] = rdispls[i] +
recvcnt[i];
186 int *count =
new int[
nprocs]();
188#pragma omp parallel for
230#pragma omp parallel for
238#if defined(GNU_PARALLEL) && defined(_OPENMP)
248#pragma omp parallel for
265 for(
int i=0; i<
nprocs; ++i)
267 sdispls[i+1] = sdispls[i] +
sendcnt1[i];
268 rdispls[i+1] = rdispls[i] +
recvcnt[i];
278 for(
int i=0; i<
nprocs; ++i)
289 count =
new int[
nprocs]();
291#pragma omp parallel for
331template <
typename PARMAT>
345 if(myrank == 0)
cout <<
" Computing the RCM ordering:" <<
endl;
389template <
typename PARMAT>
411 if(myrank == 0)
cout <<
" Computing a pseudo-peripheral vertex:" <<
endl;
421 while(
fringe.getnnz() > 0)
470 cout <<
" vertex " <<
source <<
" is a pseudo peripheral vertex" <<
endl;
479template <
typename PARMAT>
512 if(myrank==0)
cout <<
"Connected component: " <<
cc++ <<
endl;
548 for(
int i=0; i<
nprocs; ++i)
562 cout <<
"------ Detail timing --------" <<
endl;
567 cout <<
"-------------------------------" <<
endl;
574 cout <<
"-------------------------------" <<
endl;
584 cout <<
"-------------------------------" <<
endl;
599 cout <<
"summary statistics" <<
endl;
616 printf(
"ERROR: The MPI library does not have MPI_THREAD_SERIALIZED support\n");
629 cout <<
"Usage: ./rcm <rmat|er|input> <scale|filename> " <<
"-permute" <<
" -savercm" <<
endl;
630 cout <<
"Example with a user supplied matrix:" <<
endl;
631 cout <<
" mpirun -np 4 ./rcm input a.mtx" <<
endl;
632 cout <<
"Example with a user supplied matrix (pre-permute the input matrix for load balance):" <<
endl;
633 cout <<
" mpirun -np 4 ./rcm input a.mtx -permute " <<
endl;
634 cout <<
"Example with a user supplied matrix (pre-permute the input matrix for load balance) & save rcm order to input_file_name.rcm.txt file:" <<
endl;
635 cout <<
" mpirun -np 4 ./rcm input a.mtx -permute -savercm" <<
endl;
636 cout <<
"Example with RMAT matrix: mpirun -np 4 ./rcm rmat 20" <<
endl;
637 cout <<
"Example with an Erdos-Renyi matrix: mpirun -np 4 ./rcm er 20" <<
endl;
646 bool randpermute =
false;
648 for (
int i = 1; i <
argc; i++)
660 if(
string(
argv[1]) ==
string(
"input"))
675 tinfo <<
"matrix read and symmetricized " <<
endl;
680 else if(
string(
argv[1]) ==
string(
"rmat"))
684 double initiator[4] = {.57, .19, .19, .05};
693 else if(
string(
argv[1]) ==
string(
"er"))
697 double initiator[4] = {.25, .25, .25, .25};
717 if(randpermute &&
string(
argv[1]) ==
string(
"input"))
733 ABool->RemoveLoops();
753 outs <<
"--------------------------------------" <<
endl;
757 outs <<
"--------------------------------------" <<
endl;
775 if(randpermute==
true &&
randp.TotalLength() >0)
801 if(randpermute==
true &&
randp.TotalLength() >0)
int64_t PseudoPeripheralVertex(PARMAT &A, FullyDistSpVec< int64_t, pair< int64_t, int64_t > > &unvisitedVertices, FullyDistVec< int64_t, int64_t > degrees, PreAllocatedSPA< int64_t > &SPA)
double cblas_transvectime
SpParMat< int64_t, bool, SpDCCols< int64_t, bool > > Par_DCSC_Bool
double cblas_localspmvtime
double cblas_allgathertime
double cblas_alltoalltime
SpParMat< int64_t, bool, SpCCols< int64_t, bool > > Par_CSC_Bool
void RCMOrder(PARMAT &A, int64_t source, FullyDistVec< int64_t, int64_t > &order, int64_t startOrder, FullyDistVec< int64_t, int64_t > degrees, PreAllocatedSPA< int64_t > &SPA)
FullyDistVec< int64_t, int64_t > RCM(PARMAT &A, FullyDistVec< int64_t, int64_t > degrees, PreAllocatedSPA< int64_t > &SPA)
SpParMat< int64_t, double, SpDCCols< int64_t, double > > Par_DCSC_Double
FullyDistSpVec< int64_t, int64_t > getOrder(FullyDistSpVec< int64_t, VertexType > &fringeRow, int64_t startLabel, int64_t endLabel)
SpParMat< int64_t, int64_t, SpDCCols< int64_t, int64_t > > Par_DCSC_int64_t
double cblas_mergeconttime
void GenGraph500Data(double initiator[4], int log_numverts, int edgefactor, bool scramble=false, bool packed=false)
static void Print(const std::string &s)
void Symmetricize(PARMAT &A)
Dcsc< IU, typename promote_trait< NU1, NU2 >::T_promote > EWiseMult(const Dcsc< IU, NU1 > &A, const Dcsc< IU, NU2 > *B, bool exclude)
static void axpy(bool a, const T_promote &x, T_promote &y)
static T_promote add(const T_promote &arg1, const T_promote &arg2)
static T_promote multiply(const bool &arg1, const T_promote &arg2)
static bool returnedSAID()
friend bool operator<(const VertexType &vtx1, const VertexType &vtx2)
friend bool operator==(const VertexType &vtx1, const VertexType &vtx2)
VertexType(int64_t ord=-1, int64_t deg=-1)
friend bool operator>(const VertexType &vtx1, const VertexType &vtx2)
friend bool operator<=(const VertexType &vtx1, const VertexType &vtx2)
friend ostream & operator<<(ostream &os, const VertexType &vertex)
friend bool operator>=(const VertexType &vtx1, const VertexType &vtx2)
Compute the minimum of two values.