PencilArrays

Distributed Julia arrays using the MPI protocol

https://github.com/jipolanco/pencilarrays.jl

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    2 of 7 committers (28.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.2%) to scientific vocabulary

Keywords

high-performance-computing julia mpi parallel-io

Keywords from Contributors

hack interpretability pde meshing pinns standardization ode fourier interpolation pipeline-testing
Last synced: 6 months ago · JSON representation ·

Repository

Distributed Julia arrays using the MPI protocol

Basic Info
Statistics
  • Stars: 67
  • Watchers: 3
  • Forks: 9
  • Open Issues: 10
  • Releases: 61
Topics
high-performance-computing julia mpi parallel-io
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

PencilArrays

Stable Dev DOI

Build Status Coverage

Distributed Julia arrays using the MPI protocol.

This package provides a convenient framework for working with multidimensional Julia arrays distributed among MPI processes.

The name of this package originates from the decomposition of 3D domains along two out of three dimensions, sometimes called pencil decomposition. This is illustrated by the figure below, which represents a distributed 3D array. Each coloured block is managed by a different MPI process.


Pencil decomposition of 3D domains

More generally, PencilArrays can decompose arrays of arbitrary dimension N, along an arbitrary number of subdimensions M ≤ N. (In the image above, N = 3 and M = 2.)

PencilArrays is the basis for the PencilFFTs package, which provides efficient and highly scalable distributed FFTs.

Features

  • distribution of N-dimensional arrays among MPI processes;

  • decomposition of arrays along all or a subset of dimensions;

  • tools for conveniently and efficiently iterating over the coordinates of distributed multidimensional geometries;

  • transpositions between different decomposition configurations, using point-to-point and collective MPI communications;

  • zero-cost, convenient dimension permutations using the StaticPermutations.jl package;

  • convenient parallel I/O using either MPI-IO or the Parallel HDF5 libraries;

  • distributed FFTs and related transforms via the PencilFFTs.jl package.

Installation

PencilArrays can be installed using the Julia package manager:

julia> ] add PencilArrays

Quick start

```julia using MPI using PencilArrays

MPI.Init() comm = MPI.COMMWORLD # MPI communicator rank = MPI.Commrank(comm) # rank of local process

Let's decompose a 3D grid across all MPI processes.

The resulting configuration is described by a Pencil object.

dimsglobal = (42, 31, 29) # global dimensions of the array penx = Pencil(dims_global, comm)

By default the 3D grid is decomposed along the two last dimensions, similarly

to the "x-pencil" configuration in the figure above:

println(pen_x)

Decomposition of 3D data

Data dimensions: (42, 31, 29)

Decomposed dimensions: (2, 3)

Data permutation: NoPermutation()

Array type: Array

We can now allocate distributed arrays in the x-pencil configuration.

Ax = PencilArray{Float64}(undef, penx) fill!(Ax, rank * π) # each process locally fills its part of the array parent(Ax) # parent array holding the local data (here, an Array{Float64,3}) size(Ax) # total size of the array = (42, 31, 29) sizelocal(Ax) # size of local part, e.g. (42, 8, 10) for a given process range_local(Ax) # range of local part on global grid, e.g. (1:42, 16:23, 20:29)

Let's associate the dimensions to a global grid of coordinates (xi, yj, z_k)

xsglobal = range(0, 1; length = dimsglobal[1]) ysglobal = range(0, 2; length = dimsglobal[2]) zsglobal = range(0, 2π; length = dimsglobal[3])

Part of the grid associated to the local MPI process:

grid = localgrid(penx, (xsglobal, ysglobal, zsglobal))

This is convenient for example if we want to initialise the Ax array as

a function of the grid coordinates (x, y, z):

@. Ax = grid.x + (2 * grid.y * cos(grid.z))

Alternatively (useful in higher dimensions):

@. Ax = grid[1] + (2 * grid[2] * cos(grid[3]))

Create another pencil configuration, decomposing along dimensions (1, 3).

We could use the same constructor as before, but it's recommended to reuse the

previous Pencil instead to reduce memory usage.

peny = Pencil(penx; decomp_dims = (1, 3))

Now transpose from the x-pencil to the y-pencil configuration, redistributing

the data initially in Ax.

Ay = PencilArray{Float64}(undef, pen_y) transpose!(Ay, Ax)

We can check that Ax and Ay have the same data (but distributed differently)

by combining the data from all different processes onto a single process

(this should never be used for large datasets!)

gather(Ax) == gather(Ay) # true ```

Owner

  • Name: Juan Ignacio Polanco
  • Login: jipolanco
  • Kind: user
  • Location: Grenoble, France

CNRS researcher

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Polanco
    given-names: Juan Ignacio
    affiliation: Univ Lyon, CNRS, École Centrale de Lyon, LMFA
    orcid: https://orcid.org/0000-0001-7705-753X
    website: https://jipolanco.gitlab.io
title: "PencilArrays.jl: Distributed Julia arrays using the MPI protocol"
version: 0.9.9
doi: 10.5281/zenodo.5148035
date-released: 2021-07-30
repository-code: https://github.com/jipolanco/PencilArrays.jl
license: MIT

GitHub Events

Total
  • Watch event: 5
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 11
  • Pull request event: 8
  • Create event: 2
  • Commit comment event: 1
Last Year
  • Watch event: 5
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 11
  • Pull request event: 8
  • Create event: 2
  • Commit comment event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 378
  • Total Committers: 7
  • Avg Commits per committer: 54.0
  • Development Distribution Score (DDS): 0.045
Past Year
  • Commits: 11
  • Committers: 3
  • Avg Commits per committer: 3.667
  • Development Distribution Score (DDS): 0.182
Top Committers
Name Email Commits
Juan Ignacio Polanco j****c@g****m 361
github-actions[bot] 4****] 6
dependabot[bot] 4****] 4
Corentin Lothode c****e@u****r 4
Steven G. Johnson s****j@a****u 1
Chris Rackauckas a****s@c****m 1
CompatHelper Julia c****y@j****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 16
  • Total pull requests: 81
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 3 days
  • Total issue authors: 10
  • Total pull request authors: 6
  • Average comments per issue: 8.06
  • Average comments per pull request: 0.63
  • Merged pull requests: 74
  • Bot issues: 0
  • Bot pull requests: 16
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 5 hours
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.5
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • jipolanco (5)
  • corentin-dev (2)
  • tomchor (2)
  • chowland (1)
  • erny123 (1)
  • reidrr (1)
  • nick4110fi (1)
  • JuliaTagBot (1)
  • antoine-levitt (1)
  • fbignonnet (1)
Pull Request Authors
  • jipolanco (60)
  • github-actions[bot] (15)
  • dependabot[bot] (9)
  • corentin-dev (3)
  • ChrisRackauckas (1)
  • stevengj (1)
Top Labels
Issue Labels
enhancement (4)
Pull Request Labels
dependencies (9) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 44 total
  • Total dependent packages: 3
  • Total dependent repositories: 0
  • Total versions: 62
juliahub.com: PencilArrays

Distributed Julia arrays using the MPI protocol

  • Versions: 62
  • Dependent Packages: 3
  • Dependent Repositories: 0
  • Downloads: 44 Total
Rankings
Dependent repos count: 9.9%
Average: 12.7%
Stargazers count: 12.9%
Dependent packages count: 13.2%
Forks count: 14.9%
Last synced: 6 months ago

Dependencies

.github/workflows/CompatHelper.yml actions
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • codecov/codecov-action v3 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
  • julia-actions/setup-julia latest composite