29 array<char,MAXVERTNAME>
getNoNum(
int64_t index) {
return array<char,MAXVERTNAME>(); }
31 template <
typename c,
typename t>
32 array<char,MAXVERTNAME>
read(std::basic_istream<c,t>& is,
int64_t index)
34 array<char,MAXVERTNAME> strarray;
37 std::copy( str.begin(), str.end(), strarray.begin() );
38 if(str.length() <
MAXVERTNAME) strarray[str.length()] =
'\0';
43 template <
typename c,
typename t>
44 void save(std::basic_ostream<c,t>& os,
const array<char,MAXVERTNAME>& strarray,
int64_t index)
46 auto locnull = find(strarray.begin(), strarray.end(),
'\0');
47 string str(strarray.begin(), locnull);
53 int main(
int argc,
char* argv[])
56 MPI_Init(&argc, &argv);
57 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
58 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
64 cout <<
"Usage: ./ParIOTest <MatrixA> <MatrixB_general>" << endl;
65 cout <<
"<MatrixA> is an absolute address, and file should be in Matrix Market format" << endl;
66 cout <<
"<MatrixB_general> is an absolute address, file is in general triples format (MCL calls this label input)" << endl;
73 string Aname(argv[1]);
74 string Bname(argv[2]);
87 SpParHelper::Print(
"Parallel Matrix Market I/O working correctly\n");
91 SpParHelper::Print(
"ERROR in Parallel Matrix Market I/O");
SpDCCols< int64_t, NT > DCCols
FullyDistVec< IT, std::array< char, MAXVERTNAME > > ReadGeneralizedTuples(const std::string &, _BinaryOperation)
Compute the maximum of two values.
array< char, MAXVERTNAME > read(std::basic_istream< c, t > &is, int64_t index)
SelectMaxSRing< bool, int32_t > SR
void SaveGathered(std::string filename, HANDLER handler, bool transpose=false) const
int main(int argc, char *argv[])
void save(std::basic_ostream< c, t > &os, const array< char, MAXVERTNAME > &strarray, int64_t index)
void ParallelWrite(const std::string &filename, bool onebased, HANDLER handler, bool includeindices=true)
SpParMat< int64_t, NT, DCCols > MPI_DCCols
array< char, MAXVERTNAME > getNoNum(int64_t index)
void ParallelReadMM(const std::string &filename, bool onebased, _BinaryOperation BinOp)