|
1 | 1 | using Test |
2 | 2 | using PETSc, MPI |
3 | 3 | MPI.Initialized() || MPI.Init() |
4 | | -PETSc.initialize() |
5 | 4 |
|
6 | 5 | @testset "DMDACreate1D" begin |
7 | 6 | comm = MPI.COMM_WORLD |
8 | 7 | mpirank = MPI.Comm_rank(comm) |
9 | 8 | mpisize = MPI.Comm_size(comm) |
10 | 9 | for petsclib in PETSc.petsclibs |
| 10 | + PETSc.initialize(petsclib) |
11 | 11 | PetscScalar = PETSc.scalartype(petsclib) |
12 | 12 | PetscInt = PETSc.inttype(petsclib) |
13 | 13 | # Loop over all boundary types and try to use them |
@@ -108,8 +108,10 @@ PETSc.initialize() |
108 | 108 | # TODO: Need a better test? |
109 | 109 | ksp = PETSc.KSP(da) |
110 | 110 | @test PETSc.gettype(ksp) == "gmres" |
| 111 | + |
111 | 112 | end |
112 | 113 | end |
| 114 | + PETSc.finalize(petsclib) |
113 | 115 | end |
114 | 116 | end |
115 | 117 |
|
|
122 | 124 | for petsclib in PETSc.petsclibs |
123 | 125 | PetscScalar = PETSc.scalartype(petsclib) |
124 | 126 | PetscInt = PETSc.inttype(petsclib) |
| 127 | + PETSc.initialize(petsclib) |
125 | 128 | # Loop over all boundary types and stencil types |
126 | 129 | for stencil_type in instances(PETSc.DMDAStencilType), |
127 | 130 | boundary_type_y in instances(PETSc.DMBoundaryType), |
|
216 | 219 | @test PETSc.gettype(ksp) == "gmres" |
217 | 220 | end |
218 | 221 | end |
| 222 | + PETSc.finalize(petsclib) |
219 | 223 | end |
220 | 224 | end |
221 | 225 |
|
|
229 | 233 | for petsclib in PETSc.petsclibs |
230 | 234 | PetscScalar = PETSc.scalartype(petsclib) |
231 | 235 | PetscInt = PETSc.inttype(petsclib) |
| 236 | + PETSc.initialize(petsclib) |
232 | 237 | # Loop over all boundary types and stencil types |
233 | 238 | for stencil_type in instances(PETSc.DMDAStencilType), |
234 | 239 | boundary_type_z in instances(PETSc.DMBoundaryType), |
|
337 | 342 | @test PETSc.gettype(ksp) == "gmres" |
338 | 343 | end |
339 | 344 | end |
| 345 | + PETSc.finalize(petsclib) |
340 | 346 | end |
341 | 347 | end |
342 | 348 |
|
|
345 | 351 | mpirank = MPI.Comm_rank(comm) |
346 | 352 | mpisize = MPI.Comm_size(comm) |
347 | 353 | for petsclib in PETSc.petsclibs |
| 354 | + PETSc.initialize(petsclib) |
348 | 355 | PetscScalar = PETSc.scalartype(petsclib) |
349 | 356 | PetscInt = PETSc.inttype(petsclib) |
350 | 357 | boundary_type = PETSc.DM_BOUNDARY_NONE |
|
393 | 400 | @test mat[i, (i - 1):(i + 1)] == [1, -2, 1] |
394 | 401 | end |
395 | 402 | end |
| 403 | + PETSc.finalize(petsclib) |
396 | 404 | end |
397 | 405 | end |
398 | 406 |
|
|
401 | 409 | mpirank = MPI.Comm_rank(comm) |
402 | 410 | mpisize = MPI.Comm_size(comm) |
403 | 411 | for petsclib in PETSc.petsclibs |
| 412 | + PETSc.initialize(petsclib) |
404 | 413 | PetscScalar = PETSc.scalartype(petsclib) |
405 | 414 | PetscInt = PETSc.inttype(petsclib) |
406 | 415 | boundary_type = PETSc.DM_BOUNDARY_NONE |
|
472 | 481 | for (loc, glo) in enumerate(ghost_lower:ghost_upper) |
473 | 482 | @test coord_vec[loc] ≈ (glo - 1) * Δx |
474 | 483 | end |
| 484 | + PETSc.finalize(petsclib) |
475 | 485 | end |
476 | 486 | end |
477 | 487 |
|
|
0 commit comments