Skip to content

Commit

Permalink
renamed num_parts by GridapDistributed.num_parts
Browse files Browse the repository at this point in the history
  • Loading branch information
amartinhuertas committed Aug 15, 2023
1 parent 3fdd07b commit 53a0ec7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"

[[deps.Gridap]]
deps = ["AbstractTrees", "BSON", "BlockArrays", "Combinatorics", "DataStructures", "DocStringExtensions", "FastGaussQuadrature", "FileIO", "FillArrays", "ForwardDiff", "JLD2", "JSON", "LineSearches", "LinearAlgebra", "NLsolve", "NearestNeighbors", "PolynomialBases", "QuadGK", "Random", "SparseArrays", "SparseMatricesCSR", "StaticArrays", "Test", "WriteVTK"]
git-tree-sha1 = "4765f40f182559866cad17a61aef41c9bb437c21"
git-tree-sha1 = "f0f0e5d783ea0fec4e44d5e1585b95196e27ef3b"
repo-rev = "master"
repo-url = "https://github.com/gridap/Gridap.jl"
uuid = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
version = "0.17.17"

[[deps.GridapDistributed]]
deps = ["FillArrays", "Gridap", "LinearAlgebra", "MPI", "PartitionedArrays", "SparseArrays", "SparseMatricesCSR", "WriteVTK"]
git-tree-sha1 = "1e6d8a1dbfef49dd31bd4f58d72539f2c3a586ae"
git-tree-sha1 = "916a803e5526dc5baf21383b6cb2b2ea24599a03"
repo-rev = "fixing_psparse_matrix_assembly_col_partition"
repo-url = "https://github.com/gridap/GridapDistributed.jl"
uuid = "f9701e48-63b3-45aa-9a63-9bc6c271f355"
Expand Down Expand Up @@ -643,9 +643,9 @@ version = "0.6.7"

[[deps.SpecialFunctions]]
deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3"
git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "2.3.0"
version = "2.3.1"

[deps.SpecialFunctions.extensions]
SpecialFunctionsChainRulesCoreExt = "ChainRulesCore"
Expand Down
16 changes: 8 additions & 8 deletions src/OctreeDistributedDiscreteModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1568,14 +1568,14 @@ end

function _p4est_to_new_comm_old_subset_new(ptr_pXest, ptr_pXest_conn, old_comm, new_comm)
if (GridapDistributed.i_am_in(new_comm))
new_comm_num_parts = num_parts(new_comm)
new_comm_num_parts = GridapDistributed.num_parts(new_comm)
global_first_quadrant = Vector{P4est_wrapper.p4est_gloidx_t}(undef,new_comm_num_parts+1)

pXest_conn = ptr_pXest_conn[]
pertree = Vector{P4est_wrapper.p4est_gloidx_t}(undef,pXest_conn.num_trees+1)
if (GridapDistributed.i_am_in(old_comm))
pXest = ptr_pXest[]
old_comm_num_parts = num_parts(old_comm)
old_comm_num_parts = GridapDistributed.num_parts(old_comm)
old_global_first_quadrant = unsafe_wrap(Array,
pXest.global_first_quadrant,
old_comm_num_parts+1)
Expand Down Expand Up @@ -1616,10 +1616,10 @@ function _p4est_to_new_comm_old_supset_new(ptr_pXest, ptr_pXest_conn, old_comm,
p4est_comm_count_pertree(ptr_pXest,pertree)

if (GridapDistributed.i_am_in(new_comm))
new_comm_num_parts = num_parts(new_comm)
new_comm_num_parts = GridapDistributed.num_parts(new_comm)
global_first_quadrant = Vector{P4est_wrapper.p4est_gloidx_t}(undef,new_comm_num_parts+1)
pXest=ptr_pXest[]
old_comm_num_parts = num_parts(old_comm)
old_comm_num_parts = GridapDistributed.num_parts(old_comm)
old_global_first_quadrant = unsafe_wrap(Array,
pXest.global_first_quadrant,
old_comm_num_parts+1)
Expand Down Expand Up @@ -1763,8 +1763,8 @@ end

function is_included(commA::MPI.Comm,commB::MPI.Comm)
@assert GridapDistributed.i_am_in(commA) || GridapDistributed.i_am_in(commB)
num_partsA=num_parts(commA)
num_partsB=num_parts(commB)
num_partsA=GridapDistributed.num_parts(commA)
num_partsB=GridapDistributed.num_parts(commB)
if (num_partsA==num_partsB)
return false
end
Expand Down Expand Up @@ -1871,14 +1871,14 @@ function _redistribute_parts_supset_parts_redistributed(
# This piece of code replicates the logic behind the
# "p4est_partition_cut_gloidx" function in the p4est library
psub=PArrays.getany(parts_redistributed_model)
Psub=num_parts(subset_comm)
Psub=GridapDistributed.num_parts(subset_comm)
first_global_quadrant=Int64((Float64(N)*Float64(psub-1))/(Float64(Psub)))
@assert first_global_quadrant>=0 && first_global_quadrant<N
else
first_global_quadrant=N
end

Psup=num_parts(supset_comm)
Psup=GridapDistributed.num_parts(supset_comm)
psub=PArrays.getany(model.parts)
num_cells_per_part=Vector{Cint}(undef, Psup+1)
parts_offsets=MPI.Allgather(first_global_quadrant,supset_comm)
Expand Down
4 changes: 2 additions & 2 deletions test/NonConformingOctreeDistributedDiscreteModelsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ module NonConformingOctreeDistributedDiscreteModelsTests
end

function run(distribute)
debug_logger = ConsoleLogger(stderr, Logging.Debug)
global_logger(debug_logger); # Enable the debug logger globally
# debug_logger = ConsoleLogger(stderr, Logging.Debug)
# global_logger(debug_logger); # Enable the debug logger globally

ranks = distribute(LinearIndices((MPI.Comm_size(MPI.COMM_WORLD),)))
for Dc=3:3, perm=2:2, order=1:1
Expand Down

0 comments on commit 53a0ec7

Please sign in to comment.