Exploration of Unstructured Grid Face Node Indexing using Numba #979
philipc2
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
It would seem that if we can entirely write certain spherical geometry helpers using pure Numba, we would be able to use the parallel for loop with The implementation could look something like:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Is the vectorized numpy compatible with the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Exploration of Unstructured Grid Face Node Indexing using Numba
Overview
The connectivity used to represent the face node connectivity of a mixed-topology grid in the UGRID conventions is stored in a dense array, with fill values used to pad faces with less than the maximum number of nodes. This means that applying an operation (or simply accessing the indices of the nodes of each face) requires the manipulation and indexing of the
face_node_connectivity
variable. Below are various ways of accessing the nodes for each face, with an arbitraryresult
array used to store the average of index value, meant to simulate some operation.Datasets
Each face has a maximum of 6 nodes.
Machine
I ran the following tests on an Macbook Pro with an M1 pro chip and 32gb of memory. The data was able to fit comfortably into memory for each dataset.
Functions
Pure Python Loops
Numba (
@njit
)Parallel Numba (
@njit(parallel =True)
Vectorized Numpy with Partitioned Connectivity
This implementation uses a pre-partitioned
face_node_connectivity
to avoid needing to use then_nodes_per_face
variable. The implementation is being worked on in #978Results
Beta Was this translation helpful? Give feedback.
All reactions