diff --git a/.github/workflows/debug_checks.yml b/.github/workflows/debug_checks.yml index b733bb002..9f21bc82f 100644 --- a/.github/workflows/debug_checks.yml +++ b/.github/workflows/debug_checks.yml @@ -14,7 +14,7 @@ jobs: timeout-minutes: 240 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: mpi4py/setup-mpi@v1 with: mpi: 'openmpi' diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9b7cd8e00..c7a611d9a 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: version: '1.8' diff --git a/.github/workflows/documentation_cleanup.yml b/.github/workflows/documentation_cleanup.yml index c9668caa6..2e2dbc0d0 100644 --- a/.github/workflows/documentation_cleanup.yml +++ b/.github/workflows/documentation_cleanup.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout gh-pages branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: gh-pages - name: Delete preview and history + push changes diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index e05ba5bd9..36270210a 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 35 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.11' diff --git a/.github/workflows/longtest.yml b/.github/workflows/longtest.yml index 81a4bc8bf..61de8a00a 100644 --- a/.github/workflows/longtest.yml +++ b/.github/workflows/longtest.yml @@ -18,7 +18,7 @@ jobs: timeout-minutes: 90 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.11' diff --git a/.github/workflows/parallel_test.yml b/.github/workflows/parallel_test.yml index d5e963c28..a2d4a3995 100644 --- a/.github/workflows/parallel_test.yml +++ b/.github/workflows/parallel_test.yml @@ -15,7 +15,7 @@ jobs: timeout-minutes: 120 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: mpi4py/setup-mpi@v1 with: mpi: 'openmpi' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 217eafcc2..363220a10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 50 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.11' diff --git a/src/communication.jl b/src/communication.jl index c296e6705..e2c2789ae 100644 --- a/src/communication.jl +++ b/src/communication.jl @@ -357,9 +357,9 @@ function allocate_shared(T, dims) if br == 0 # Allocate points on rank-0 for simplicity - n_local = n + dims_local = dims else - n_local = 0 + dims_local = Tuple(0 for _ ∈ dims) end @debug_shared_array_allocate begin @@ -385,26 +385,18 @@ function allocate_shared(T, dims) end end - win, ptr = MPI.Win_allocate_shared(T, n_local, comm_block[]) + win, array_temp = MPI.Win_allocate_shared(Array{T}, dims_local, comm_block[]) - # Array is allocated contiguously, but `ptr` points to the 'locally owned' part. - # We want to use as a shared array, so want to wrap the entire shared array. - # Get start pointer of array from rank-0 process. Cannot use ptr, as this - # is null when n_local=0. - _, _, base_ptr = MPI.Win_shared_query(win, 0) - base_ptr = Ptr{T}(base_ptr) - - if base_ptr == Ptr{Nothing}(0) - error("Got null pointer when trying to allocate shared array") - end + # Array is allocated contiguously, but `array_temp` contains only the 'locally owned' + # part. We want to use as a shared array, so want to wrap the entire shared array. + # Get array from rank-0 process, which 'owns' the whole array. + array = MPI.Win_shared_query(Array{T}, dims, win; rank=0) # Don't think `win::MPI.Win` knows about the type of the pointer (its concrete type # is something like `MPI.Win(Ptr{Nothing} @0x00000000033affd0)`), so it's fine to # put them all in the same global_Win_store - this won't introduce type instability push!(global_Win_store, win) - array = unsafe_wrap(Array, base_ptr, dims) - @debug_shared_array begin # If @debug_shared_array is active, create DebugMPISharedArray instead of Array debug_array = DebugMPISharedArray(array) diff --git a/src/velocity_grid_transforms.jl b/src/velocity_grid_transforms.jl index 10329c0a1..368ee73c2 100644 --- a/src/velocity_grid_transforms.jl +++ b/src/velocity_grid_transforms.jl @@ -38,7 +38,7 @@ function vzvrvzeta_to_vpavperp_species!(f_out,f_in,vz,vr,vzeta,vpa,vperp,gyropha @boundscheck vpa.n == size(f_out, 1) || throw(BoundsError(f_out)) @boundscheck vperp.n == size(f_out, 2) || throw(BoundsError(f_out)) - pdf_interp = LinearInterpolation((vz.grid,vr.grid,vzeta.grid),f_in,extrapolation_bc = 0.0) + pdf_interp = linear_interpolation((vz.grid,vr.grid,vzeta.grid),f_in,extrapolation_bc = 0.0) # pdf_interp( vz_val, vr_val, vzeta_val) is interpolated value of f_in # extrapolation_bc = 0.0 makes pdf_interp = 0.0 for |vx| > vx.L/2 (x = z,r,zeta) @@ -92,7 +92,7 @@ function vpavperp_to_vzvrvzeta_species!(f_out,f_in,vz,vr,vzeta,vpa,vperp,geometr @boundscheck vpa.n == size(f_in, 1) || throw(BoundsError(f_in)) @boundscheck vperp.n == size(f_in, 2) || throw(BoundsError(f_in)) - pdf_interp = LinearInterpolation((vpa.grid,vperp.grid),f_in,extrapolation_bc = 0.0) + pdf_interp = linear_interpolation((vpa.grid,vperp.grid),f_in,extrapolation_bc = 0.0) # pdf_interp( vz_val, vr_val, vzeta_val) is interpolated value of f_in # extrapolation_bc = 0.0 makes pdf_interp = 0.0 for |vpa| > vpa.L/2 and vperp > vperp.L