Skip to content

Commit 9bbe401

Browse files
authored
Merge pull request #102 from MultiSimOLab/fix-mpi
Cleanup: removed MPI dependencies
2 parents bae16b0 + 2a6d715 commit 9bbe401

8 files changed

Lines changed: 46 additions & 36 deletions

File tree

Project.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@ BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
99
DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
1010
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1111
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
12-
GridapDistributed = "f9701e48-63b3-45aa-9a63-9bc6c271f355"
1312
GridapGmsh = "3025c34a-b394-11e9-2a55-3fee550c04c8"
14-
GridapPETSc = "bcdc36c2-0c3e-11ea-095a-c9dadae499f1"
1513
GridapSolvers = "6d3209ee-5e3c-4db7-a716-942eb12ed534"
1614
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
1715
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1816
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
19-
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
2017
Profile = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
2118
ProfileView = "c46f51b8-102a-5cf2-8d2c-8597cb0e0da7"
2219
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
2320
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2421
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
2522
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
2623

24+
[weakdeps]
25+
GridapDistributed = "f9701e48-63b3-45aa-9a63-9bc6c271f355"
26+
GridapPETSc = "bcdc36c2-0c3e-11ea-095a-c9dadae499f1"
27+
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
28+
29+
[extensions]
30+
HyperFEMDistributed = ["GridapDistributed", "GridapPETSc", "PartitionedArrays"]
31+
2732
[compat]
2833
AbstractTrees = "0.4"
2934
BlockArrays = "1.9"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module ComputationalModels
2+
3+
using HyperFEM
4+
using Gridap, GridapDistributed, GridapPETSc
5+
using PartitionedArrays
6+
using PartitionedArrays: getany
7+
8+
include("FESpaces.jl")
9+
include("GridapExtras.jl")
10+
11+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
import HyperFEM.instantiate_caches
3+
4+
function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator)
5+
return GridapPETSc._setup_cache(x, nls, op)
6+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
import HyperFEM.ComputationalModels.get_local_matrix_type
3+
import HyperFEM.ComputationalModels.get_local_vector_type
4+
import HyperFEM.ComputationalModels.get_local_assembly_strategy
5+
6+
function get_local_matrix_type(a::GridapDistributed.DistributedSparseMatrixAssembler)
7+
return getany(map(get_matrix_type,a.assems))
8+
end
9+
function get_local_vector_type(a::GridapDistributed.DistributedSparseMatrixAssembler)
10+
return getany(map(get_vector_type,a.assems))
11+
end
12+
function get_local_assembly_strategy(a::GridapDistributed.DistributedSparseMatrixAssembler)
13+
return get_assembly_strategy(a)
14+
end

ext/HyperFEMDistributed.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module HyperFEMDistributed
2+
3+
using HyperFEM
4+
5+
include("ComputationalModels/ComputationalModels.jl")
6+
7+
end

src/ComputationalModels/ComputationalModels.jl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ using Gridap.FESpaces: get_assembly_strategy
1111
import Gridap: solve!
1212

1313
using BlockArrays
14-
using GridapPETSc, GridapPETSc.PETSC
15-
using GridapPETSc: PetscScalar, PetscInt, PETSC
16-
17-
using GridapDistributed
18-
using GridapDistributed: DistributedDiscreteModel, DistributedTriangulation,
19-
DistributedFESpace, DistributedDomainContribution, to_parray_of_arrays,
20-
allocate_in_domain, DistributedCellField, DistributedMultiFieldCellField,
21-
DistributedMultiFieldFEBasis, BlockPMatrix, BlockPVector, change_ghost
22-
23-
using PartitionedArrays
24-
using PartitionedArrays: getany
25-
2614
using GridapSolvers
2715
using GridapSolvers.LinearSolvers, GridapSolvers.NonlinearSolvers, GridapSolvers.BlockSolvers
2816
using GridapSolvers.SolverInterfaces: SolverVerboseLevel, SOLVER_VERBOSE_NONE, SOLVER_VERBOSE_LOW, SOLVER_VERBOSE_HIGH

src/ComputationalModels/FESpaces.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,3 @@ function instantiate_caches(x, nls::Newton_RaphsonSolver, op::NonlinearOperator)
144144
ns = numerical_setup(ss, A, x)
145145
return Newton_RaphsonCache(A, b, dx, ns)
146146
end
147-
148-
149-
function instantiate_caches(x, nls::PETScNonlinearSolver, op::NonlinearOperator)
150-
return GridapPETSc._setup_cache(x, nls, op)
151-
end
152-
153-
154-
155-
156-
157-

src/ComputationalModels/GridapExtras.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ get_local_matrix_type(a::Assembler) = get_matrix_type(a)
1616
get_local_vector_type(a::Assembler) = get_vector_type(a)
1717
get_local_assembly_strategy(a::Assembler) = get_assembly_strategy(a)
1818

19-
function get_local_matrix_type(a::GridapDistributed.DistributedSparseMatrixAssembler)
20-
return getany(map(get_matrix_type,a.assems))
21-
end
22-
function get_local_vector_type(a::GridapDistributed.DistributedSparseMatrixAssembler)
23-
return getany(map(get_vector_type,a.assems))
24-
end
25-
function get_local_assembly_strategy(a::GridapDistributed.DistributedSparseMatrixAssembler)
26-
return get_assembly_strategy(a)
27-
end
28-
2919
function get_local_matrix_type(a::MultiField.BlockSparseMatrixAssembler)
3020
return get_local_matrix_type(first(a.block_assemblers))
3121
end

0 commit comments

Comments
 (0)