diff --git a/AMDiS/src/ParallelDomainBase.cc b/AMDiS/src/ParallelDomainBase.cc index 1acc732e586defec1a54bf8a84bd873269fc4340..520bbf7760924971f1da31b2d4cec8a851e0ffb4 100644 --- a/AMDiS/src/ParallelDomainBase.cc +++ b/AMDiS/src/ParallelDomainBase.cc @@ -409,9 +409,10 @@ namespace AMDiS { it != recvDofs.end(); ++it) { int nSend = sendMatrixEntry[it->first].size(); - if (nSend > 0) + if (nSend > 0) { request[requestCounter++] = mpiComm.Isend(sendBuffers[i], nSend * 2, MPI_INT, it->first, 0); + } i++; } @@ -436,10 +437,10 @@ namespace AMDiS { } MPI::Request::Waitall(requestCounter, request); - + for (int j = 0; j < static_cast<int>(sendBuffers.size()); j++) if (sendBuffers[j]) - delete [] sendBuffers[j]; + delete [] sendBuffers[j]; i = 0; for (RankToDofContainer::iterator it = sendDofs.begin(); @@ -450,7 +451,7 @@ namespace AMDiS { int c = recvBuffers[i][j * 2 + 1]; r -= rstart * nComponents; - + TEST_EXIT_DBG(r >= 0 && r < nRankRows)("Should not happen!\n"); if (c < rstart * nComponents || @@ -460,6 +461,8 @@ namespace AMDiS { delete [] recvBuffers[i]; } + + i++; } INFO(info, 8)("Fill petsc matrix 1 needed %.5f seconds\n", TIME_USED(first, clock()));