Skip to content

Commit

Permalink
Fix: generalize hard-coded Cint to MPI_Comm in `t8_forest_get_mpi…
Browse files Browse the repository at this point in the history
…comm`. (#78)

* Applied minor fixes.

* Added another patch replace line.

---------

Co-authored-by: Johannes Markert <johannes.markert@dlr.de>
  • Loading branch information
jmark and Johannes Markert authored Dec 5, 2024
1 parent 73877de commit 3f7b1fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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 <johannes.markert@dlr.de>"]
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

0 comments on commit 3f7b1fc

Please sign in to comment.