FastIce.jl
Documentation for FastIce.jl
Information about the STREAM project can be found in the GPU4GEO website
diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 4965ca5a..2c3e1990 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-01-12T22:25:49","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-01-21T18:56:26","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 662fb516..166203b8 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -
Documentation for FastIce.jl
Information about the STREAM project can be found in the GPU4GEO website
Settings
This document was generated with Documenter.jl version 1.2.1 on Friday 12 January 2024. Using Julia version 1.9.4.
Documentation for FastIce.jl
Information about the STREAM project can be found in the GPU4GEO website
Settings
This document was generated with Documenter.jl version 1.2.1 on Sunday 21 January 2024. Using Julia version 1.9.4.
FastIce.Grids.CartesianGrid
— MethodCartesianGrid(; origin::NTuple{N,T}, extent::NTuple{N,T}, size::NTuple{N,I})
Create a Cartesian grid with a specified origin (bottom-south-west corner in 3D), spatial extent, and number of grid cells.
FastIce.Grids.DiscreteAxis
— TypeDiscretised one-dimensional interval. Grid type CartesianGrid
is defined as a tuple of DiscreteAxis
's.
FastIce.Grids.axis
— Methodaxis(grid::CartesianGrid, dim::Integer)
Return a DiscreteAxis
corresponding to the spatial dimension dim
.
FastIce.Grids.coord
— Methodcoord(grid::CartesianGrid{N}, loc::NTuple{N,Location}, inds::NTuple{N})
Return a tuple of spatial coordinates of a grid point at location loc
and indices inds
.
For vertex-centered locations, first grid point is at the origin. For cell-centered locations, first grid point at half-spacing distance from the origin.
FastIce.Grids.extent
— Methodextent(grid::CartesianGrid)
Return the spatial extent of a CartesianGrid
as a tuple.
FastIce.Grids.origin
— Methodorigin(grid::CartesianGrid)
Return the origin of a CartesianGrid
. The origin corresponds to bottom-south-west corner of the grid in 3D.
FastIce.Grids.spacing
— Methodspacing(grid::CartesianGrid)
Return the spacing of a CartesianGrid
as a tuple.
FastIce.Grids.Δ
— MethodΔ(grid::CartesianGrid)
Return the spacing of a CartesianGrid
as a tuple. Same as spacing
.
FastIce.Architectures.Architecture
— MethodArchitecture(backend::Backend, topology::CartesianTopology) where {N}
Create a distributed Architecture using backend
and topology
. For GPU backends, device will be selected automatically based on a process id within a node.
FastIce.Distributed.CartesianTopology
— TypeCartesianTopology
Represents N-dimensional Cartesian topology of distributed processes.
FastIce.Distributed.CartesianTopology
— MethodCartesianTopology(dims::NTuple{N,Int}; comm=MPI.COMM_WORLD) where {N}
Create an N-dimensional Cartesian topology with dimensions dims
and using base MPI communicator comm
(by default, comm=MPI.COMM_WORLD
). If all entries in dims
are not equal to 0
, the product of dims
should be equal to the total number of MPI processes MPI.Comm_size(comm)
. If any (or all) entries of dims
are 0
, the dimensions in the corresponding spatial directions will be picked automatically.
FastIce.Distributed.DistributedMPI
— TypeTrait structure used as a type parameter to indicate that the Architecture is a distributed MPI Architecture.
FastIce.Distributed.ExchangeInfo
— TypeExchangeInfo
Structure containing the information to exchange halos of one side of an N-dimensional array.
FastIce.Distributed.ExchangeInfo
— MethodExchangeInfo(::Val{S}, ::Val{D}, field::Field) where {S,D}
Create ExchangeInfo
to exchange halos on side S
in the spatial direction D
.
FastIce.BoundaryConditions.apply_boundary_conditions!
— Methodapply_boundary_conditions!(::Val{S}, ::Val{D},
+ y ∈ [0.0–1.0]; Δy = 0.25
FastIce.Grids.CartesianGrid
— MethodCartesianGrid(; origin::NTuple{N,T}, extent::NTuple{N,T}, size::NTuple{N,I})
Create a Cartesian grid with a specified origin (bottom-south-west corner in 3D), spatial extent, and number of grid cells.
FastIce.Grids.DiscreteAxis
— TypeDiscretised one-dimensional interval. Grid type CartesianGrid
is defined as a tuple of DiscreteAxis
's.
FastIce.Grids.axis
— Methodaxis(grid::CartesianGrid, dim::Integer)
Return a DiscreteAxis
corresponding to the spatial dimension dim
.
FastIce.Grids.coord
— Methodcoord(grid::CartesianGrid{N}, loc::NTuple{N,Location}, inds::NTuple{N})
Return a tuple of spatial coordinates of a grid point at location loc
and indices inds
.
For vertex-centered locations, first grid point is at the origin. For cell-centered locations, first grid point at half-spacing distance from the origin.
FastIce.Grids.extent
— Methodextent(grid::CartesianGrid)
Return the spatial extent of a CartesianGrid
as a tuple.
FastIce.Grids.origin
— Methodorigin(grid::CartesianGrid)
Return the origin of a CartesianGrid
. The origin corresponds to bottom-south-west corner of the grid in 3D.
FastIce.Grids.spacing
— Methodspacing(grid::CartesianGrid)
Return the spacing of a CartesianGrid
as a tuple.
FastIce.Grids.Δ
— MethodΔ(grid::CartesianGrid)
Return the spacing of a CartesianGrid
as a tuple. Same as spacing
.
FastIce.Architectures.Architecture
— MethodArchitecture(backend::Backend, topology::CartesianTopology) where {N}
Create a distributed Architecture using backend
and topology
. For GPU backends, device will be selected automatically based on a process id within a node.
FastIce.Distributed.CartesianTopology
— TypeCartesianTopology
Represents N-dimensional Cartesian topology of distributed processes.
FastIce.Distributed.CartesianTopology
— MethodCartesianTopology(dims::NTuple{N,Int}; comm=MPI.COMM_WORLD) where {N}
Create an N-dimensional Cartesian topology with dimensions dims
and using base MPI communicator comm
(by default, comm=MPI.COMM_WORLD
). If all entries in dims
are not equal to 0
, the product of dims
should be equal to the total number of MPI processes MPI.Comm_size(comm)
. If any (or all) entries of dims
are 0
, the dimensions in the corresponding spatial directions will be picked automatically.
FastIce.Distributed.DistributedMPI
— TypeTrait structure used as a type parameter to indicate that the Architecture is a distributed MPI Architecture.
FastIce.Distributed.ExchangeInfo
— TypeExchangeInfo
Structure containing the information to exchange halos of one side of an N-dimensional array.
FastIce.Distributed.ExchangeInfo
— MethodExchangeInfo(::Val{S}, ::Val{D}, field::Field) where {S,D}
Create ExchangeInfo
to exchange halos on side S
in the spatial direction D
.
FastIce.BoundaryConditions.apply_boundary_conditions!
— Methodapply_boundary_conditions!(::Val{S}, ::Val{D},
arch::Architecture,
grid::CartesianGrid,
fields::NTuple{N,Field},
- exchange_infos::NTuple{N,ExchangeInfo}; async=true) where {S,D,N}
Perform a non-blocking MPI exchange for a set of fields.
FastIce.Distributed.cartesian_communicator
— Methodcartesian_communicator(t::CartesianTopology)
MPI Cartesian communicator for the topology.
FastIce.Distributed.coordinates
— Methodcoordinates(t::CartesianTopology)
Coordinates of a current process within a Cartesian topology.
FastIce.Distributed.dimensions
— Methoddimensions(t::CartesianTopology)
Dimensions of the topology as NTuple.
FastIce.Distributed.gather!
— Methodgather!(arch::Architecture{DistributedMPI}, dst, src::Field; kwargs...)
Gather the interior of a field src
into a global array dst
.
FastIce.Distributed.gather!
— Methodgather!(dst::Union{AbstractArray{T,N},Nothing}, src::AbstractArray{T,N}, comm::MPI.Comm; root=0) where {T,N}
Gather local array src
into a global array dst
. Size of the global array size(dst)
should be equal to the product of the size of a local array size(src)
and the dimensions of a Cartesian communicator comm
. The array will be gathered on the process with id root
(root=0
by default). Note that the memory for a global array should be allocated only on the process with id root
, on other processes dst
can be set to nothing
.
FastIce.Distributed.global_grid_size
— Methodglobal_grid_size(t::CartesianTopology, local_size)
Return the global size for a structured grid.
FastIce.Distributed.global_rank
— Methodglobal_rank(t::CartesianTopology)
Global id of a process in a Cartesian topology.
FastIce.Distributed.global_size
— Methodglobal_size(t::CartesianTopology)
Total number of processes withing the topology.
FastIce.Distributed.has_neighbor
— Methodhas_neighbor(t::CartesianTopology, dim, side)
Returns true if there a neighbor process in spatial direction dim
on the side side
, or false otherwise.
FastIce.Distributed.local_grid
— Methodlocal_grid(g::CartesianGrid, t::CartesianTopology)
Return a CartesianGrid
covering the subdomain which corresponds to the current process.
FastIce.Distributed.neighbor
— Methodneighbor(t::CartesianTopology, dim, side)
Returns id of a neighbor process in spatial direction dim
on the side side
, if this neighbor exists, or MPI.PROC_NULL otherwise.
FastIce.Distributed.neighbors
— Methodneighbors(t::CartesianTopology)
Neighbors of a current process.
Returns NTuple containing process ids of the two immediate neighbors in each spatial direction, or MPI.PROC_NULL if no neighbor on a corresponding side.
FastIce.Distributed.node_name
— Methodnode_name(t::CartesianTopology)
Name of a node according to MPI.Get_processor_name()
.
FastIce.Distributed.node_size
— Methodnode_size(t::CartesianTopology)
Number of processes sharing the same node.
FastIce.Distributed.shared_communicator
— Methodshared_communicator(t::CartesianTopology)
MPI communicator for the processes sharing the same node.
FastIce.Distributed.shared_rank
— Methodshared_rank(t::CartesianTopology)
Local id of a process within a single node. Can be used to set the GPU device.
FastIce.KernelLaunch.launch!
— Methodlaunch!(arch::Architecture, grid::CartesianGrid, kernel::Pair{K,Args}; <keyword arguments>) where {K,Args}
Launch a KernelAbstraction kernel
on a grid
using the backend from arch
. Either worksize
or location
must be provided as keyword arguments.
Keyword Arguments
worksize
: worksize of a kernel, i.e. how many grid points are included in each spatial direction.location[=nothing]
: compute worksize as a size of the grid at a specified location. If only one location is provided, e.g. location=Vertex()
, then this location will be used for all spacial directions.offset[=nothing]
: index offset for all grid indices as a CartesianIndex
.expand[=nothing]
: if provided, the worksize is increased by 2*expand
, and offset is set to -expand
, or combined with user-provided offset.hide_boundaries[=nothing]
: instance of HideBoundaries
, that will be used to overlap boundary processing with computations at inner points of the domain.outer_width[=nothing]
: if hide_boundaries
is specified, used to determine the decomposition of the domain into inner and outer regions.boundary_conditions[=nothing]
: a tuple of boundary condition batches for each side of every spatial direction.async[=true]
: if set to false
, will block the host until the kernel is finished executing.FastIce.Writers.write_h5
— Methodwrite_h5(arch::Architecture, grid::CartesianGrid, path, fields)
Write output fields
in HDF5 format to a file on path
.
FastIce.Writers.write_h5
— Methodwrite_h5(arch::Architecture{DistributedMPI}, grid::CartesianGrid, path, fields)
Write output fields
in HDF5 format to a file on path
for global grid
on distributed arch
.
FastIce.Writers.write_xdmf
— Functionwrite_xdmf(arch::Architecture{DistributedMPI}, grid::CartesianGrid, path, fields, h5_names, timesteps=Float64(0.0))
Write Xdmf metadata to path
for corresponding h5_names
and fields
for global grid
on distributed arch
. Saving time-dependant data can be achieved upon passing a vector to h5_names
and timesteps
.
FastIce.Writers.write_xdmf
— Functionwrite_xdmf(arch::Architecture, grid::CartesianGrid, path, fields, h5_names, timesteps=Float64(0.0))
Write Xdmf metadata to path
for corresponding h5_names
and fields
. Saving time-dependant data can be achieved upon passing a vector to h5_names
and timesteps
.
Settings
This document was generated with Documenter.jl version 1.2.1 on Friday 12 January 2024. Using Julia version 1.9.4.