Skip to content
Snippets Groups Projects
Commit eecb3b56 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Fixed the last nnz structure problem. Now go on to make it fast.

parent 2bbf10f7
Branches
Tags
No related merge requests found
...@@ -145,6 +145,7 @@ namespace AMDiS { ...@@ -145,6 +145,7 @@ namespace AMDiS {
*coarseSpaceMap, *coarseSpaceMap,
*coarseSpaceMap, *coarseSpaceMap,
nnzCoarse); nnzCoarse);
createPetscNnzStructureWithCoarseSpace(mat, createPetscNnzStructureWithCoarseSpace(mat,
*coarseSpaceMap, *coarseSpaceMap,
*interiorMap, *interiorMap,
...@@ -185,18 +186,18 @@ namespace AMDiS { ...@@ -185,18 +186,18 @@ namespace AMDiS {
MatCreateAIJ(mpiCommGlobal, MatCreateAIJ(mpiCommGlobal,
nRowsRankCoarse, nRowsRankInterior, nRowsRankCoarse, nRowsRankInterior,
nRowsOverallCoarse, nGlobalOverallInterior, nRowsOverallCoarse, nGlobalOverallInterior,
100, PETSC_NULL, 100, PETSC_NULL, // 100, PETSC_NULL, 100, PETSC_NULL,
// 0, nnzCoarseInt.dnnz, 0, nnzCoarseInt.onnz, 0, nnzCoarseInt.dnnz, 0, nnzCoarseInt.onnz,
&matCoarseInt); &matCoarseInt);
MatSetOption(matCoarseInt, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); // MatSetOption(matCoarseInt, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
MatCreateAIJ(mpiCommGlobal, MatCreateAIJ(mpiCommGlobal,
nRowsRankInterior, nRowsRankCoarse, nRowsRankInterior, nRowsRankCoarse,
nGlobalOverallInterior, nRowsOverallCoarse, nGlobalOverallInterior, nRowsOverallCoarse,
100, PETSC_NULL, 100, PETSC_NULL, // 100, PETSC_NULL, 100, PETSC_NULL,
// 0, nnzIntCoarse.dnnz, 0, nnzIntCoarse.onnz, 0, nnzIntCoarse.dnnz, 0, nnzIntCoarse.onnz,
&matIntCoarse); &matIntCoarse);
MatSetOption(matIntCoarse, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); // MatSetOption(matIntCoarse, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
} }
// === Prepare traverse of sequentially created matrices. === // === Prepare traverse of sequentially created matrices. ===
...@@ -340,9 +341,6 @@ namespace AMDiS { ...@@ -340,9 +341,6 @@ namespace AMDiS {
MatAssemblyEnd(matCoarseInt, MAT_FINAL_ASSEMBLY); MatAssemblyEnd(matCoarseInt, MAT_FINAL_ASSEMBLY);
} }
AMDiS::finalize();
exit(0);
// === Remove Dirichlet BC DOFs. === // === Remove Dirichlet BC DOFs. ===
// removeDirichletBcDofs(mat); // removeDirichletBcDofs(mat);
...@@ -1443,9 +1441,9 @@ namespace AMDiS { ...@@ -1443,9 +1441,9 @@ namespace AMDiS {
// matrices, the problem may arise, that the result is larger than the // matrices, the problem may arise, that the result is larger than the
// number of elements in a row. This is fixed in the following. // number of elements in a row. This is fixed in the following.
// if (nRankRows < 100) if (nRankRows < 100)
// for (int i = 0; i < nRankRows; i++) for (int i = 0; i < nRankRows; i++)
// nnzInterior.dnnz[i] = std::min(nnzInterior.dnnz[i], nRankCols); nnz.dnnz[i] = std::min(nnz.dnnz[i], nRankCols);
#if (DEBUG != 0) #if (DEBUG != 0)
int nMax = 0; int nMax = 0;
...@@ -1470,6 +1468,7 @@ namespace AMDiS { ...@@ -1470,6 +1468,7 @@ namespace AMDiS {
MSG("NNZ in offdiag block: max = %d, avrg = %.0f\n", MSG("NNZ in offdiag block: max = %d, avrg = %.0f\n",
nMax, (nSum > 0 ? (static_cast<double>(nSum) / nRankRows) : 0)); nMax, (nSum > 0 ? (static_cast<double>(nSum) / nRankRows) : 0));
} }
}
#endif #endif
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment