30#include "CombBLAS/CommGrid.h"
31#include "CombBLAS/SpDefs.h"
44 if(grrows == 0 && grcols == 0)
46 grrows = (
int)std::sqrt((
float)
nproc);
49 if(grcols * grrows !=
nproc)
51 cerr <<
"This version of the Combinatorial BLAS only works on a square logical processor grid" <<
endl;
57 myproccol = (
int) (myrank % grcols);
58 myprocrow = (
int) (myrank / grcols);
83 diagWorld = commWorld;
87 for(
int i=0; i < grcols; ++i)
105 return ( myproccol == ((
int) (
rhsrank % grcols)) );
110 return ( myprocrow == ((
int) (
rhsrank / grcols)) );
149 return ( (grrows ==
rhs.grrows) && (grcols ==
rhs.grcols) && (myprocrow ==
rhs.myprocrow) && (myproccol ==
rhs.myproccol));
159 string ofilename =
prefix;
161 output.open(ofilename.c_str(), ios_base::app );
168 cout <<
"Grids don't confirm for multiplication" <<
endl;
bool operator==(const CommGrid &rhs) const
bool OnSameProcRow(int rhsrank)
void OpenDebugFile(std::string prefix, std::ofstream &output) const
bool OnSameProcCol(int rhsrank)
CommGrid(MPI_Comm world, int nrowproc, int ncolproc)
shared_ptr< CommGrid > ProductGrid(CommGrid *gridA, CommGrid *gridB, int &innerdim, int &Aoffset, int &Boffset)