1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
diff --git a/Applications/BipartiteMatchings/BPMaximalMatching.cpp b/Applications/BipartiteMatchings/BPMaximalMatching.cpp
index d116e761..0b2cc1d0 100644
--- a/Applications/BipartiteMatchings/BPMaximalMatching.cpp
+++ b/Applications/BipartiteMatchings/BPMaximalMatching.cpp
@@ -70,8 +70,9 @@ void removeIsolated(PSpMat_Bool & A)
{
int nprocs, myrank;
- MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
+ MPI_Comm comm = A.getcommgrid()->GetWorld();
+ MPI_Comm_size(comm,&nprocs);
+ MPI_Comm_rank(comm,&myrank);
FullyDistVec<int64_t, int64_t> * ColSums = new FullyDistVec<int64_t, int64_t>(A.getcommgrid());
@@ -121,7 +122,7 @@ void removeIsolated(PSpMat_Bool & A)
cout << nrows2 << " " << ncols2 << " " << nnz2 << " " << avgDeg2 << " \n";
}
- MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Barrier(comm);
}
diff --git a/Applications/BipartiteMatchings/BPMaximalMatching.h b/Applications/BipartiteMatchings/BPMaximalMatching.h
index eef74142..01ee8551 100644
--- a/Applications/BipartiteMatchings/BPMaximalMatching.h
+++ b/Applications/BipartiteMatchings/BPMaximalMatching.h
@@ -26,8 +26,9 @@ void MaximalMatching(Par_DCSC_Bool & A, Par_DCSC_Bool & AT, FullyDistVec<IT, IT>
{
typedef VertexTypeML < IT, IT> VertexType;
- MPI_Comm comm = A.getcommgrid()->GetWorld();
+
int nprocs, myrank;
+ MPI_Comm comm = A.getcommgrid()->GetWorld();
MPI_Comm_size(comm,&nprocs);
MPI_Comm_rank(comm,&myrank);
int nthreads = 1;
diff --git a/Applications/BipartiteMatchings/BPMaximumMatching.cpp b/Applications/BipartiteMatchings/BPMaximumMatching.cpp
index b917ca7d..4b168f24 100644
--- a/Applications/BipartiteMatchings/BPMaximumMatching.cpp
+++ b/Applications/BipartiteMatchings/BPMaximumMatching.cpp
@@ -49,8 +49,9 @@ void removeIsolated(Par_DCSC_Bool & A)
{
int nprocs, myrank;
- MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
+ MPI_Comm comm = A.getcommgrid()->GetWorld();
+ MPI_Comm_size(comm,&nprocs);
+ MPI_Comm_rank(comm,&myrank);
FullyDistVec<int64_t, int64_t> * ColSums = new FullyDistVec<int64_t, int64_t>(A.getcommgrid());
@@ -100,7 +101,7 @@ void removeIsolated(Par_DCSC_Bool & A)
cout << nrows2 << " " << ncols2 << " " << nnz2 << " " << avgDeg2 << " \n";
}
- MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Barrier(comm);
}
@@ -282,8 +283,9 @@ void experiment_maximal(Par_DCSC_Bool & A, Par_DCSC_Bool & AT, FullyDistVec<int6
{
int nprocs, myrank;
- MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
+ MPI_Comm comm = A.getcommgrid()->GetWorld();
+ MPI_Comm_size(comm,&nprocs);
+ MPI_Comm_rank(comm,&myrank);
FullyDistVec<int64_t, int64_t> mateRow2Col ( A.getcommgrid(), A.getnrow(), (int64_t) -1);
FullyDistVec<int64_t, int64_t> mateCol2Row ( A.getcommgrid(), A.getncol(), (int64_t) -1);
diff --git a/Applications/BipartiteMatchings/BPMaximumMatching.h b/Applications/BipartiteMatchings/BPMaximumMatching.h
index 86ff625f..9d66823a 100644
--- a/Applications/BipartiteMatchings/BPMaximumMatching.h
+++ b/Applications/BipartiteMatchings/BPMaximumMatching.h
@@ -183,9 +183,10 @@ void AugmentPath(FullyDistVec<IT, IT>& mateRow2Col, FullyDistVec<IT, IT>& mateCo
IT locind_row, locind_col;
int myrank;
- MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-
-
+ MPI_Comm comm = mateRow2Col.getcommgrid()->GetWorld();
+ MPI_Comm_rank(comm,&myrank);
+
+
for(IT i=0; i<leaves.LocArrSize(); i++)
{
int depth=0;
@@ -244,8 +245,9 @@ void maximumMatching(SpParMat < IT, NT, DER > & A, FullyDistVec<IT, IT>& mateRow
double tstart = MPI_Wtime();
int nprocs, myrank;
- MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
+ MPI_Comm comm = A.getcommgrid()->GetWorld();
+ MPI_Comm_size(comm,&nprocs);
+ MPI_Comm_rank(comm,&myrank);
IT nrow = A.getnrow();
IT ncol = A.getncol();
|