Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: generalize hard-coded Cint to MPI_Comm in t8_forest_get_mpicomm. #78

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "T8code"
uuid = "d0cc0030-9a40-4274-8435-baadcfd54fa1"
authors = ["Johannes Markert <[email protected]>"]
version = "0.7.2"
version = "0.7.3"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down
6 changes: 5 additions & 1 deletion dev/fixes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ LIB_JL="Libt8.jl"

set -euxo pipefail

sed -i "s/using CEnum/using CEnum: @cenum/g" "${LIB_JL}"

# Remove Fortran macros
sed -i "/INTEGER(KIND/d" "${LIB_JL}"

Expand All @@ -25,8 +27,10 @@ sed -i "s/mpifile::Cint/mpifile::MPI_File/g" "${LIB_JL}"
sed -i "s/mpidatatype::Cint/mpidatatype::MPI_Datatype/g" "${LIB_JL}"
sed -i "s/\bt::Cint/t::MPI_Datatype/g" "${LIB_JL}"

sed -i "s/forest::Cint/forest::t8_forest_t/" "${LIB_JL}"
sed -i "s/t8_forest_get_mpicomm\(forest::t8_forest_t\)::Cint/t8_forest_get_mpicomm(forest::t8_forest_t)::MPI_Comm/g" "${LIB_JL}"

sed -i "s/forest::Cint/forest::t8_forest_t/" "${LIB_JL}"
sed -i "s/cmesh::Cint/cmesh::t8_cmesh_t/" "${LIB_JL}"

# Use libsc for `sc_*` functions
sed -i "s/libt8\.sc_/libsc.sc_/g" "${LIB_JL}"
Expand Down
8 changes: 4 additions & 4 deletions src/Libt8.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ end
const ptrdiff_t = Cptrdiff_t

# Definitions used from MPI.jl
using MPI: MPI, MPI_Datatype, MPI_Comm, MPI_Group, MPI_File
using MPI: MPI, MPI_Datatype, MPI_Comm, MPI_File

const MPI_COMM_WORLD = MPI.COMM_WORLD
const MPI_COMM_SELF = MPI.COMM_SELF
Expand Down Expand Up @@ -13125,7 +13125,7 @@ end
"""
t8_stash_attribute_sort(stash)

Sort the attributes array of a stash in the order (treeid, packageid, key) *
Sort the attributes array of a stash in the order (treeid, package_id, key) *

# Arguments
* `stash`:\\[in,out\\] The stash to be considered.
Expand Down Expand Up @@ -15698,7 +15698,7 @@ sc_MPI_Comm t8_forest_get_mpicomm (const t8_forest_t forest);
```
"""
function t8_forest_get_mpicomm(forest)
@ccall libt8.t8_forest_get_mpicomm(forest::t8_forest_t)::Cint
@ccall libt8.t8_forest_get_mpicomm(forest::t8_forest_t)::MPI_Comm
end

"""
Expand Down Expand Up @@ -17844,7 +17844,7 @@ void t8_geom_load_tree_data_vertices (t8_cmesh_t cmesh, t8_gloidx_t gtreeid, con
```
"""
function t8_geom_load_tree_data_vertices(cmesh, gtreeid, user_data)
@ccall libt8.t8_geom_load_tree_data_vertices(cmesh::Cint, gtreeid::Cint, user_data::Ptr{Ptr{Cvoid}})::Cvoid
@ccall libt8.t8_geom_load_tree_data_vertices(cmesh::t8_cmesh_t, gtreeid::Cint, user_data::Ptr{Ptr{Cvoid}})::Cvoid
end

"""
Expand Down
Loading