Planet v0.1.1 GEOF.Planet.SphereServer
The main server for running computations over the Sphere.
## Naming conventions:
In all servers for GEOF.Planet, the names panel
and field
are equivalent to panel_index
and
field_index
respectively for the sake of brevity. The data belonging to a field is always
field_data
, and a group of such data is sphere_data
, whether it’s data for just part of
the sphere or for the entire sphere.
In the servers’ APIs, get
is always a call, and send
and receive
are always casts.
Atoms surrounded with double-underscores indicate messages and state keys that are intended
only to be used by methods internal to SphereServer
and PanelServer
. Once an iteration is
complete, no remaining messages or state keys should be present in the system.
Link to this section Summary
Types
An arbitrary set of unique Field indices
A mapping for Field indices belonging to each Panel index
A reference to a function to be called for each field during a compute frame
A Panel index. Spheres will manage a limited number of Panels, so this is just a non-negative integer
Information about a particular Sphere, including its geometry
A mapping for Field data belonging to each Field index in a Sphere
A Sphere reference. Any number of Spheres could be running, so this is a reference
Functions
Returns a specification to start this module under a supervisor
Gets the data for each Field in the Sphere
Starts a compute frame. The SphereServer will send frame_complete
when finished
Starts a SphereServer. This will automatically divide the Sphere into Panels (contiguous subsets of the Sphere’s Fields) based on the number of cores available and spawn the servers needed to run compute frames
Link to this section Types
An arbitrary set of unique Field indices.
A mapping for Field indices belonging to each Panel index.
A reference to a function to be called for each field during a compute frame.
A Panel index. Spheres will manage a limited number of Panels, so this is just a non-negative integer.
sphere() :: %{ id: reference(), divisions: GEOF.Planet.Sphere.divisions(), field_centroids: GEOF.Planet.Geometry.FieldCentroids.centroid_sphere(), interfield_centroids: GEOF.Planet.Geometry.InterfieldCentroids.interfield_centroid_sphere(), fields_at_panels: fields_at_panels(), n_panels: non_neg_integer() }
Information about a particular Sphere, including its geometry.
A mapping for Field data belonging to each Field index in a Sphere.
A Sphere reference. Any number of Spheres could be running, so this is a reference
.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
get_all_field_data(sphere_id()) :: sphere_data()
Gets the data for each Field in the Sphere.
init_sphere(GEOF.Planet.Sphere.divisions(), sphere_id()) :: sphere()
Starts a compute frame. The SphereServer will send frame_complete
when finished.
start_link(GEOF.Planet.Sphere.divisions(), sphere_id()) :: GenServer.on_start()
Starts a SphereServer. This will automatically divide the Sphere into Panels (contiguous subsets of the Sphere’s Fields) based on the number of cores available and spawn the servers needed to run compute frames.