diff --git a/Project.toml b/Project.toml index 2ec1523..f276f02 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GridapGmsh" uuid = "3025c34a-b394-11e9-2a55-3fee550c04c8" authors = ["Francesc Verdugo "] -version = "0.6.1" +version = "0.7.0" [deps] Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e" @@ -12,10 +12,10 @@ PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" gmsh_jll = "630162c2-fc9b-58b3-9910-8442a8a132e6" [compat] -Gridap = "0.17" -GridapDistributed = "0.2.4" +Gridap = "0.17.18" +GridapDistributed="0.3.0" Metis = "1" -PartitionedArrays = "0.2" +PartitionedArrays = "0.3.3" gmsh_jll = "4.7.1" julia = "1.3" diff --git a/demo/demo_parallel.jl b/demo/demo_parallel.jl index d381300..8e2deb0 100644 --- a/demo/demo_parallel.jl +++ b/demo/demo_parallel.jl @@ -4,10 +4,11 @@ using GridapPETSc using GridapDistributed using PartitionedArrays n = 6 -prun(mpi,n) do parts +with_mpi() do distribute + ranks=distribute(LinearIndices((n,))) options = "-ksp_type cg -pc_type gamg -ksp_monitor" GridapPETSc.with(args=split(options)) do - model = GmshDiscreteModel(parts,"demo/demo.msh") + model = GmshDiscreteModel(ranks,"demo/demo.msh") order = 1 dirichlet_tags = ["boundary1","boundary2"] u_boundary1(x) = 0.0 diff --git a/src/GmshDiscreteModels.jl b/src/GmshDiscreteModels.jl index 257a7ee..552b893 100644 --- a/src/GmshDiscreteModels.jl +++ b/src/GmshDiscreteModels.jl @@ -790,7 +790,7 @@ function _find_gface_to_face( ngfaces = length(gface_to_nodes_ptrs) - 1 gface_to_face = fill(T(UNSET),ngfaces) - n = max_cells_arround_vertex(node_to_faces_ptrs) + n = max_cells_around_vertex(node_to_faces_ptrs) faces_around = fill(UNSET,n) faces_around_scratch = fill(UNSET,n) @@ -940,7 +940,7 @@ end ## Parallel related -function GmshDiscreteModel(parts::PArrays.AbstractPData, args...;kwargs...) +function GmshDiscreteModel(parts::AbstractVector, args...;kwargs...) GmshDiscreteModel(parts,args...;kwargs...) do g,np if np == 1 fill(Int32(1),size(g,1)) @@ -952,7 +952,7 @@ end function GmshDiscreteModel( do_partition, - parts::PArrays.AbstractPData, + parts::AbstractVector, args...;kwargs...) smodel = GmshDiscreteModel(args...;kwargs...) diff --git a/src/GridapGmsh.jl b/src/GridapGmsh.jl index a898a66..ca1d08e 100644 --- a/src/GridapGmsh.jl +++ b/src/GridapGmsh.jl @@ -9,7 +9,7 @@ using Gridap.TensorValues using Gridap.Fields using Gridap.ReferenceFEs using Gridap.Geometry -using Gridap.Geometry: max_cells_arround_vertex +using Gridap.Geometry: max_cells_around_vertex using Gridap.Geometry: _fill_cells_around_scratch! using Gridap.Geometry: _set_intersection! using Gridap.Geometry: _generate_cell_to_vertices_from_grid diff --git a/test/DistributedTests.jl b/test/DistributedTests.jl index 839846b..5dce1be 100644 --- a/test/DistributedTests.jl +++ b/test/DistributedTests.jl @@ -6,9 +6,10 @@ using GridapDistributed using PartitionedArrays using Test -function main(parts) +function main(distribute,n) + ranks=distribute(LinearIndices((n,))) mshfile = joinpath(@__DIR__,"..","demo","demo.msh") - model = GmshDiscreteModel(parts,mshfile) + model = GmshDiscreteModel(ranks,mshfile) k = 2 Ω = Interior(model) reffe = ReferenceFE(lagrangian,Float64,k) @@ -19,10 +20,19 @@ function main(parts) dΩ = Measure(Ω,2*k) @test sum(∫( eh*eh )dΩ) < 1.0e-9 writevtk(Ω,"Ω",cellfields=["uh"=>uh,"eh"=>eh]) -end +end -prun(main,sequential,6) -prun(main,sequential,1) -prun(main,mpi,1) +with_debug() do distribute + main(distribute,6) + main(distribute,1) +end + +with_mpi() do distribute + main(distribute,1) +end + +#prun(main,sequential,6) +#prun(main,sequential,1) +#prun(main,mpi,1) end # module