1 #include "../CombBLAS.h" 14 int main(
int argc,
char* argv[])
19 MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
20 if (provided < MPI_THREAD_SERIALIZED)
22 printf(
"ERROR: The MPI library does not have MPI_THREAD_SERIALIZED support\n");
23 MPI_Abort(MPI_COMM_WORLD, 1);
26 MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
27 MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
31 int totalen = (
int64_t) atoi(argv[1]);
32 int locallen = totalen/nprocs;
33 totalen = locallen * nprocs;
35 vector<int64_t> ind1 (locallen, -1);
36 vector<int64_t> ind2 (locallen, -1);
37 vector<double> val (locallen, 0.0);
38 vector<int> disp(nprocs);
39 vector<int> recvcnt(nprocs);
40 for(
int i=0; i<nprocs; i++)
43 recvcnt[i] = locallen;
48 vector<int64_t> recv1 ;
49 vector<int64_t> recv2 ;
50 vector<double> recv3 ;
54 recv1.resize(totalen);
55 recv2.resize(totalen);
56 recv3.resize(totalen);
59 double t1 = MPI_Wtime();
64 double t2 = MPI_Wtime() - t1;
67 cout <<
"time : " << t2*2 << endl;
MPI_Datatype MPIType< int64_t >(void)
MPI_Datatype MPIType< double >(void)
int main(int argc, char *argv[])