diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a6d40a..bbc8039 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,44 +59,44 @@ jobs: t8code_version: - '4.0.0' t8code_snapshot: - - '26.08' + - '26.09' include: - julia-version: '1.10' julia-arch: 'default' os: macos-latest mpi-provider: JLL_MPI t8code_version: '4.0.0' - t8code_snapshot: '26.08' + t8code_snapshot: '26.09' - julia-version: '1' julia-arch: 'default' os: macos-latest mpi-provider: JLL_MPI t8code_version: '4.0.0' - t8code_snapshot: '26.08' + t8code_snapshot: '26.09' - julia-version: 'nightly' julia-arch: 'default' os: macos-latest mpi-provider: JLL_MPI t8code_version: '4.0.0' - t8code_snapshot: '26.08' + t8code_snapshot: '26.09' - julia-version: '1.10' julia-arch: 'x64' os: ubuntu-latest mpi-provider: SYSTEM_MPI t8code_version: '4.0.0' - t8code_snapshot: '26.08' + t8code_snapshot: '26.09' - julia-version: '1' julia-arch: 'x64' os: ubuntu-latest mpi-provider: SYSTEM_MPI t8code_version: '4.0.0' - t8code_snapshot: '26.08' + t8code_snapshot: '26.09' - julia-version: 'nightly' julia-arch: 'x64' os: ubuntu-latest mpi-provider: SYSTEM_MPI t8code_version: '4.0.0' - t8code_snapshot: '26.08' + t8code_snapshot: '26.09' steps: - name: Checkout repository uses: actions/checkout@v7 diff --git a/Project.toml b/Project.toml index 653c9e8..536bbc9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "T8code" uuid = "d0cc0030-9a40-4274-8435-baadcfd54fa1" authors = ["Johannes Markert "] -version = "0.10.0" +version = "0.10.1" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" @@ -22,4 +22,4 @@ Preferences = "1.2.1" Reexport = "0.2, 1.0" UUIDs = "1" julia = "1.10" -t8code_jll = "=4.0.8" +t8code_jll = "=4.0.9" diff --git a/dev/Artifacts.toml b/dev/Artifacts.toml index d131e62..3ebf274 100644 --- a/dev/Artifacts.toml +++ b/dev/Artifacts.toml @@ -1,11 +1,11 @@ [[t8code]] arch = "x86_64" -git-tree-sha1 = "db9d00b1eaecef9135b00cad5d6d498a16998b17" +git-tree-sha1 = "b81773896950985f6eb96c161a7a6b4b0f6ab69d" lazy = true libc = "glibc" mpi = "mpich" os = "linux" [[t8code.download]] - sha256 = "cc76e7345a1f30673093970be94713d5fe43fb76e6acb01ea0237b5d148d0caf" - url = "https://github.com/JuliaBinaryWrappers/t8code_jll.jl/releases/download/t8code-v4.0.8+0/t8code.v4.0.8.x86_64-linux-gnu-mpi+mpich.tar.gz" + sha256 = "e4df562727a3219a6e7e81ef80960c2d52f2bd6960b3d93d91d5dc69896091bc" + url = "https://github.com/JuliaBinaryWrappers/t8code_jll.jl/releases/download/t8code-v4.0.9+0/t8code.v4.0.9.x86_64-linux-gnu-mpi+mpich.tar.gz" diff --git a/dev/Manifest.toml b/dev/Manifest.toml index edb206b..052a86e 100644 --- a/dev/Manifest.toml +++ b/dev/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.13.0" +julia_version = "1.13.1" manifest_format = "2.1" project_hash = "9d22e3e87a2b3ee1d45816c9d075b31dc75cae0f" @@ -90,7 +90,7 @@ version = "1.9.1+0" [[deps.LibSSH2_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl", "OpenSSL_jll", "Zlib_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.103+0" +version = "1.11.104+0" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -191,7 +191,7 @@ version = "1.5.7+1" [[deps.libLLVM_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl", "Zlib_jll", "Zstd_jll"] uuid = "8f36deef-c2a5-5394-99ed-8e07531fb29a" -version = "20.1.8+1" +version = "20.1.8+2" [[deps.nghttp2_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] diff --git a/dev/README.md b/dev/README.md index d6e12ab..226949d 100644 --- a/dev/README.md +++ b/dev/README.md @@ -89,8 +89,11 @@ julia> Pkg.test("T8code") ``` If anything fails, you might have to update the generator workflow (step 7) or start -debugging the tests. If all goes well, go ahead and open a pull request. Make sure to -include `Artifacts.toml`, reflecting the sources you used. Include `dev/Manifest.toml` as -well to make the generation reproducible. +debugging the tests. If all goes well, go ahead and open a pull request. + +- make sure to include `Artifacts.toml`, reflecting the sources you used +- include `dev/Manifest.toml` to make the generation reproducible +- adapt the t8code version in `.github/workflows/test.yml` + Once this pull request has been merged, downstream packages can start adopting your new t8code release! diff --git a/dev/generator.toml b/dev/generator.toml index 0f1409f..a831d3a 100644 --- a/dev/generator.toml +++ b/dev/generator.toml @@ -166,6 +166,7 @@ output_ignorelist = [ "sc_MPI_Irecv", "sc_MPI_Send", "sc_MPI_Isend", + "sc_MPI_Sendrecv", "sc_MPI_Probe", "sc_MPI_Iprobe", "sc_MPI_Get_count", diff --git a/src/Libt8.jl b/src/Libt8.jl index 407eabe..0faed75 100644 --- a/src/Libt8.jl +++ b/src/Libt8.jl @@ -106,7 +106,7 @@ Print a message to stderr and then call [`sc_abort`](@ref) (). ### Prototype ```c -void sc_abort_verbose (const char *filename, int lineno, const char *msg) __attribute__ ((noreturn)); +SC_NORETURN void sc_abort_verbose (const char *filename, int lineno, const char *msg); ``` """ function sc_abort_verbose(filename, lineno, msg) @@ -207,7 +207,7 @@ end """ sc_array -The [`sc_array`](@ref) object provides a dynamic array of equal-size elements. Elements are accessed by their 0-based index. Their address may change. The number of elements (== elem\\_count) of the array can be changed by sc_array_resize and sc_array_rewind. Elements can be sorted with sc_array_sort. If the array is sorted, it can be searched with sc_array_bsearch. A priority queue is implemented with pqueue\\_add and pqueue\\_pop (untested). +The [`sc_array`](@ref) object provides a dynamic array of equal-size elements. Elements are accessed by their 0-based index. Their address may change. The number of elements (== elem\\_count) of the array can be changed by sc_array_resize and sc_array_rewind. Elements can be sorted with sc_array_sort. If the array is sorted, it can be searched with sc_array_bsearch. A maximum-first priority queue is implemented with sc_array_pqueue_insert, sc_array_pqueue_pop and further helpers. | Field | Note | | :----------- | :---------------------------------------------------------------------------------------------------------------------------------------------- | @@ -223,7 +223,7 @@ struct sc_array array::Cstring end -"""The [`sc_array`](@ref) object provides a dynamic array of equal-size elements. Elements are accessed by their 0-based index. Their address may change. The number of elements (== elem\\_count) of the array can be changed by sc_array_resize and sc_array_rewind. Elements can be sorted with sc_array_sort. If the array is sorted, it can be searched with sc_array_bsearch. A priority queue is implemented with pqueue\\_add and pqueue\\_pop (untested).""" +"""The [`sc_array`](@ref) object provides a dynamic array of equal-size elements. Elements are accessed by their 0-based index. Their address may change. The number of elements (== elem\\_count) of the array can be changed by sc_array_resize and sc_array_rewind. Elements can be sorted with sc_array_sort. If the array is sorted, it can be searched with sc_array_bsearch. A maximum-first priority queue is implemented with sc_array_pqueue_insert, sc_array_pqueue_pop and further helpers.""" const sc_array_t = sc_array """ @@ -904,7 +904,7 @@ Print a stack trace, call the abort handler and then call abort (). ### Prototype ```c -void sc_abort (void) __attribute__ ((noreturn)); +SC_NORETURN void sc_abort (void); ``` """ function sc_abort() @@ -918,7 +918,7 @@ Collective abort where only root prints a message ### Prototype ```c -void sc_abort_collective (const char *msg) __attribute__ ((noreturn)); +SC_NORETURN void sc_abort_collective (const char *msg); ``` """ function sc_abort_collective(msg) @@ -1862,67 +1862,101 @@ function sc_array_checksum(array) end """ - sc_array_pqueue_add(array, temp, compar) + sc_array_pqueue_siftup(array, pos, newval, compar) -Adds an element to a priority queue. +Replace an element in a priority queue with another and sift up. The priority queue is implemented as a binary heap in descending order. It is a maximum heap: The largest values have highest priority. The new element is inserted at a given position and must not be less than the descendants below that position. This function is not allowed for views. -!!! note - - PQUEUE FUNCTIONS ARE UNTESTED AND CURRENTLY DISABLED. This function is not allowed for views. The priority queue is implemented as a heap in ascending order. A heap is a binary tree where the children are not less than their parent. Assumes that elements [0]..[elem\\_count-2] form a valid heap. Then propagates [elem\\_count-1] upward by swapping if necessary. +# Arguments +* `array`:\\[in,out\\] Valid priority queue, not a view. +* `pos`:\\[in\\] Valid position in priority queue. +* `newval`:\\[in\\] Read-only storage of the new value. Must reside outside of the array. +* `compar`:\\[in\\] A comparison function to be used. +# Returns +The number of swap operations. +### Prototype +```c +size_t sc_array_pqueue_siftup (sc_array_t * array, size_t pos, void *newval, int (*compar) (const void *, const void *)); +``` +""" +function sc_array_pqueue_siftup(array, pos, newval, compar) + @ccall libsc.sc_array_pqueue_siftup(array::Ptr{sc_array_t}, pos::Csize_t, newval::Ptr{Cvoid}, compar::Ptr{Cvoid})::Csize_t +end -!!! note +""" + sc_array_pqueue_insert(array, newval, compar) - If the return value is zero for all elements in an array, the array is sorted linearly and unchanged. +Add an element to a priority queue. The priority queue is implemented as a heap in descending order. It is a maximum heap: The largest values have highest priority. This function augments the priority queue by one element. This function is not allowed for views. # Arguments -* `array`:\\[in,out\\] Valid priority queue object. -* `temp`:\\[in\\] Pointer to unused allocated memory of elem\\_size. -* `compar`:\\[in\\] The comparison function to be used. +* `array`:\\[in,out\\] Valid priority queue, not a view. Enlarged by one element. +* `newval`:\\[in\\] Read-only storage of the new value. +* `compar`:\\[in\\] A comparison function to be used. # Returns -Returns the number of swap operations. +The number of swap operations. ### Prototype ```c -size_t sc_array_pqueue_add (sc_array_t * array, void *temp, int (*compar) (const void *, const void *)); +size_t sc_array_pqueue_insert (sc_array_t * array, void *newval, int (*compar) (const void *, const void *)); ``` """ -function sc_array_pqueue_add(array, temp, compar) - @ccall libsc.sc_array_pqueue_add(array::Ptr{sc_array_t}, temp::Ptr{Cvoid}, compar::Ptr{Cvoid})::Csize_t +function sc_array_pqueue_insert(array, newval, compar) + @ccall libsc.sc_array_pqueue_insert(array::Ptr{sc_array_t}, newval::Ptr{Cvoid}, compar::Ptr{Cvoid})::Csize_t end """ - sc_array_pqueue_pop(array, result, compar) - -Pops the smallest element from a priority queue. + sc_array_pqueue_siftdown(array, maxcount, pos, newval, compar) -!!! note +Replace an element in a priority queue with another and sift down. The priority queue is implemented as a binary heap in descending order. It is a maximum heap: The largest values have highest priority. The new element is inserted at a given position and must not be greater than its ancestors above that position. This function is not allowed for views. - PQUEUE FUNCTIONS ARE UNTESTED AND CURRENTLY DISABLED. This function is not allowed for views. This function assumes that the array forms a valid heap in ascending order. +# Arguments +* `array`:\\[in,out\\] Valid priority queue, not a view. +* `maxcount`:\\[in\\] Less or equal than *array*'s element count. Work only with this amount of array elements. +* `pos`:\\[in\\] Valid position less than *maxcount*. +* `newval`:\\[in\\] Read-only storage of the new value. Must reside outside of the first maxcount array positions. +* `compar`:\\[in\\] A comparison function to be used. +# Returns +The number of swap operations. +### Prototype +```c +size_t sc_array_pqueue_siftdown (sc_array_t * array, size_t maxcount, size_t pos, void *newval, int (*compar) (const void *, const void *)); +``` +""" +function sc_array_pqueue_siftdown(array, maxcount, pos, newval, compar) + @ccall libsc.sc_array_pqueue_siftdown(array::Ptr{sc_array_t}, maxcount::Csize_t, pos::Csize_t, newval::Ptr{Cvoid}, compar::Ptr{Cvoid})::Csize_t +end -!!! note +""" + sc_array_pqueue_pop(array, newval, compar) - This function resizes the array to elem\\_count-1. +Pop the largest element from a priority queue. The priority queue is implemented as a binary heap in descending order. It is a maximum heap: The largest values have highest priority. The root of the heap is removed and returned. This function is not allowed for views. # Arguments -* `array`:\\[in,out\\] Valid priority queue object. -* `result`:\\[out\\] Pointer to unused allocated memory of elem\\_size. -* `compar`:\\[in\\] The comparison function to be used. +* `array`:\\[in,out\\] Valid priority queue, not a view. Shrunk by one element. +* `newval`:\\[in\\] Storage for the maximum value removed. +* `compar`:\\[in\\] A comparison function to be used. # Returns -Returns the number of swap operations. +The number of swap operations. ### Prototype ```c -size_t sc_array_pqueue_pop (sc_array_t * array, void *result, int (*compar) (const void *, const void *)); +size_t sc_array_pqueue_pop (sc_array_t * array, void *newval, int (*compar) (const void *, const void *)); ``` """ -function sc_array_pqueue_pop(array, result, compar) - @ccall libsc.sc_array_pqueue_pop(array::Ptr{sc_array_t}, result::Ptr{Cvoid}, compar::Ptr{Cvoid})::Csize_t +function sc_array_pqueue_pop(array, newval, compar) + @ccall libsc.sc_array_pqueue_pop(array::Ptr{sc_array_t}, newval::Ptr{Cvoid}, compar::Ptr{Cvoid})::Csize_t end """ sc_array_index(array, iz) +Returns a pointer to an array element. + +# Arguments +* `array`:\\[in\\] Valid array. +* `iz`:\\[in\\] Needs to be in [0]..[elem\\_count-1]. +# Returns +Pointer to the indexed array element. ### Prototype ```c -static inline void * sc_array_index (sc_array_t * array, size_t iz); +inline void * sc_array_index (sc_array_t * array, size_t iz); ``` """ function sc_array_index(array, iz) @@ -1932,9 +1966,16 @@ end """ sc_array_index_null(array, iz) +Returns a pointer to an array element or NULL at the array's end. + +# Arguments +* `array`:\\[in\\] Valid array. +* `iz`:\\[in\\] Needs to be in [0]..[elem\\_count]. +# Returns +Pointer to the indexed array element or NULL if the specified index is elem\\_count. ### Prototype ```c -static inline void * sc_array_index_null (sc_array_t * array, size_t iz); +inline void * sc_array_index_null (sc_array_t * array, size_t iz); ``` """ function sc_array_index_null(array, iz) @@ -1944,9 +1985,14 @@ end """ sc_array_index_int(array, i) +Returns a pointer to an array element indexed by a plain int. + +# Arguments +* `array`:\\[in\\] Valid array. +* `i`:\\[in\\] Needs to be in [0]..[elem\\_count-1]. ### Prototype ```c -static inline void * sc_array_index_int (sc_array_t * array, int i); +inline void * sc_array_index_int (sc_array_t * array, int i); ``` """ function sc_array_index_int(array, i) @@ -1956,9 +2002,14 @@ end """ sc_array_index_long(array, l) +Returns a pointer to an array element indexed by a plain long. + +# Arguments +* `array`:\\[in\\] Valid array. +* `l`:\\[in\\] Needs to be in [0]..[elem\\_count-1]. ### Prototype ```c -static inline void * sc_array_index_long (sc_array_t * array, long l); +inline void * sc_array_index_long (sc_array_t * array, long l); ``` """ function sc_array_index_long(array, l) @@ -1968,9 +2019,14 @@ end """ sc_array_index_ssize_t(array, is) +Returns a pointer to an array element indexed by a ssize\\_t. + +# Arguments +* `array`:\\[in\\] Valid array. +* `is`:\\[in\\] Needs to be in [0]..[elem\\_count-1]. ### Prototype ```c -static inline void * sc_array_index_ssize_t (sc_array_t * array, ssize_t is); +inline void * sc_array_index_ssize_t (sc_array_t * array, ssize_t is); ``` """ function sc_array_index_ssize_t(array, is) @@ -1980,9 +2036,14 @@ end """ sc_array_index_int16(array, i16) +Returns a pointer to an array element indexed by a int16\\_t. + +# Arguments +* `array`:\\[in\\] Valid array. +* `i16`:\\[in\\] Needs to be in [0]..[elem\\_count-1]. ### Prototype ```c -static inline void * sc_array_index_int16 (sc_array_t * array, int16_t i16); +inline void * sc_array_index_int16 (sc_array_t * array, int16_t i16); ``` """ function sc_array_index_int16(array, i16) @@ -1992,9 +2053,14 @@ end """ sc_array_position(array, element) +Return the index of an object in an array identified by a pointer. + +# Arguments +* `array`:\\[in\\] Valid array. +* `element`:\\[in\\] Needs to be the address of an element in **array**. ### Prototype ```c -static inline size_t sc_array_position (sc_array_t * array, void *element); +inline size_t sc_array_position (sc_array_t * array, void *element); ``` """ function sc_array_position(array, element) @@ -2004,9 +2070,13 @@ end """ sc_array_pop(array) +Remove the last element from an array and return a pointer to it. This function is not allowed for views. + +# Returns +The pointer to the removed object. Will be valid as long as no other function is called on this array. ### Prototype ```c -static inline void * sc_array_pop (sc_array_t * array); +inline void * sc_array_pop (sc_array_t * array); ``` """ function sc_array_pop(array) @@ -2016,9 +2086,13 @@ end """ sc_array_push_count(array, add_count) +Enlarge an array by a number of elements. Grows the array if necessary. This function is not allowed for views. + +# Returns +Returns a pointer to the uninitialized newly added elements. ### Prototype ```c -static inline void * sc_array_push_count (sc_array_t * array, size_t add_count); +inline void * sc_array_push_count (sc_array_t * array, size_t add_count); ``` """ function sc_array_push_count(array, add_count) @@ -2028,9 +2102,13 @@ end """ sc_array_push(array) +Enlarge an array by one element. Grows the array if necessary. This function is not allowed for views. + +# Returns +Returns a pointer to the uninitialized newly added element. ### Prototype ```c -static inline void * sc_array_push (sc_array_t * array); +inline void * sc_array_push (sc_array_t * array); ``` """ function sc_array_push(array) @@ -2311,9 +2389,13 @@ end """ sc_mempool_alloc(mempool) +Allocate a single element. Elements previously returned to the pool are recycled. + +# Returns +Returns a new or recycled element pointer. ### Prototype ```c -static inline void * sc_mempool_alloc (sc_mempool_t * mempool); +inline void * sc_mempool_alloc (sc_mempool_t * mempool); ``` """ function sc_mempool_alloc(mempool) @@ -2323,9 +2405,14 @@ end """ sc_mempool_free(mempool, elem) +Return a previously allocated element to the pool. + +# Arguments +* `mempool`:\\[in,out\\] Valid memory pool. +* `elem`:\\[in\\] The element to be returned to the pool. ### Prototype ```c -static inline void sc_mempool_free (sc_mempool_t * mempool, void *elem); +inline void sc_mempool_free (sc_mempool_t * mempool, void *elem); ``` """ function sc_mempool_free(mempool, elem) @@ -4954,7 +5041,7 @@ function t8_element_get_last_descendant(scheme, tree_class, element, desc, level end """ - t8_element_get_successor(scheme, tree_class, elem1, elem2) + t8_element_construct_successor(scheme, tree_class, elem1, elem2) Construct the successor in a uniform refinement of a given element. @@ -4965,11 +5052,11 @@ Construct the successor in a uniform refinement of a given element. * `elem2`:\\[in,out\\] The element whose entries will be set. ### Prototype ```c -void t8_element_get_successor (const t8_scheme_c *scheme, const t8_eclass_t tree_class, const t8_element_t *elem1, t8_element_t *elem2); +void t8_element_construct_successor (const t8_scheme_c *scheme, const t8_eclass_t tree_class, const t8_element_t *elem1, t8_element_t *elem2); ``` """ -function t8_element_get_successor(scheme, tree_class, elem1, elem2) - @ccall libt8.t8_element_get_successor(scheme::Ptr{t8_scheme_c}, tree_class::t8_eclass_t, elem1::Ptr{t8_element_t}, elem2::Ptr{t8_element_t})::Cvoid +function t8_element_construct_successor(scheme, tree_class, elem1, elem2) + @ccall libt8.t8_element_construct_successor(scheme::Ptr{t8_scheme_c}, tree_class::t8_eclass_t, elem1::Ptr{t8_element_t}, elem2::Ptr{t8_element_t})::Cvoid end """ @@ -20921,26 +21008,28 @@ const SC_PACKAGE_BUGREPORT = "p4est@ins.uni-bonn.de" const SC_PACKAGE_NAME = "libsc" -const SC_PACKAGE_STRING = "libsc 2.8.7" +const SC_PACKAGE_STRING = "libsc 0.0.0" const SC_PACKAGE_TARNAME = "libsc" const SC_PACKAGE_URL = "" -const SC_PACKAGE_VERSION = "2.8.7" +const SC_PACKAGE_VERSION = "0.0.0" -const SC_VERSION = "2.8.7" +const SC_VERSION = "0.0.0" -const SC_VERSION_MAJOR = 2 +const SC_VERSION_MAJOR = 0 -const SC_VERSION_MINOR = 8 +const SC_VERSION_MINOR = 0 -const SC_VERSION_POINT = 7 +const SC_VERSION_POINT = 0 # Skipping MacroDefinition: _sc_const const # Skipping MacroDefinition: SC_DLL_PUBLIC __attribute__ ( ( visibility ( "default" ) ) ) +# Skipping MacroDefinition: SC_NORETURN __attribute__ ( ( noreturn ) ) + const sc_MPI_COMM_WORLD = MPI.COMM_WORLD const sc_MPI_COMM_SELF = MPI.COMM_SELF