openPMD-api
 
Loading...
Searching...
No Matches
openPMD::chunk_assignment::PartialStrategy Struct Referenceabstract

A chunk distribution strategy that guarantees no complete distribution. More...

#include <ChunkInfo.hpp>

Inheritance diagram for openPMD::chunk_assignment::PartialStrategy:
PyPartialStrategy openPMD::chunk_assignment::ByHostname

Public Member Functions

PartialAssignment assign (ChunkTable table, RankMeta const &in, RankMeta const &out, size_t my_rank, size_t num_ranks)
 Assign chunks to be loaded to reading processes.
 
virtual PartialAssignment assign (PartialAssignment partialAssignment, RankMeta const &in, RankMeta const &out, size_t my_rank, size_t num_ranks)=0
 Assign chunks to be loaded to reading processes.
 
virtual std::unique_ptr< PartialStrategyclone () const =0
 

Detailed Description

A chunk distribution strategy that guarantees no complete distribution.

Combine with a full Strategy using the FromPartialStrategy struct to obtain a Strategy that works in two phases:

  1. Apply the partial strategy.
  2. Apply the full strategy to assign unassigned leftovers.

A typical partial assignment strategy is ByHostname, which can assign chunks only within one compute node and will fail if there is no consumer in that same compute node.

Member Function Documentation

◆ assign() [1/2]

PartialAssignment openPMD::chunk_assignment::PartialStrategy::assign ( ChunkTable table,
RankMeta const & in,
RankMeta const & out,
size_t my_rank,
size_t num_ranks )

Assign chunks to be loaded to reading processes.

Parameters
tableChunk table obtained by BaseRecordComponent::availableChunks(). Merge the unassigned chunks into the partially assigned table.
inMeta information on writing processes, e.g. hostnames.
outMeta information on reading processes, e.g. hostnames.
my_rankRank identifier for the current process. Will be considered by some distribution strategies that may be called for only a subselection of the data space (e.g. for distributing data within processes on the same compute node in a cluster).
num_ranksNumber of processes among which chunks are to be distributed. Will be considered by some distribution strategies that may be called for only a subselection of the data space (e.g. for distributing data within processes on the same compute node in a cluster).
Returns
Two chunktables, one of leftover chunks that were not assigned and one that assigns chunks to reading processes. Assigned chunks are sorted by the destination process ID (MPI rank). Distribution strategies will in general only need to fill the chunks for the current (calling) process ID. Chunks assigned to another destination processes may be silently dropped.

◆ assign() [2/2]

virtual PartialAssignment openPMD::chunk_assignment::PartialStrategy::assign ( PartialAssignment partialAssignment,
RankMeta const & in,
RankMeta const & out,
size_t my_rank,
size_t num_ranks )
pure virtual

Assign chunks to be loaded to reading processes.

To be defined by implementors.

Parameters
partialAssignmentTwo chunktables, one of unassigned chunks and one of chunks that might have already been assigned previously. Merge the unassigned chunks into the partially assigned table.
inMeta information on writing processes, e.g. hostnames.
outMeta information on reading processes, e.g. hostnames.
my_rankRank identifier for the current process. Will be considered by some distribution strategies that may be called for only a subselection of the data space (e.g. for distributing data within processes on the same compute node in a cluster).
num_ranksNumber of processes among which chunks are to be distributed. Will be considered by some distribution strategies that may be called for only a subselection of the data space (e.g. for distributing data within processes on the same compute node in a cluster).
Returns
Two chunktables, one of leftover chunks that were not assigned and one that assigns chunks to reading processes. Assigned chunks are sorted by the destination process ID (MPI rank). Distribution strategies will in general only need to fill the chunks for the current (calling) process ID. Chunks assigned to another destination processes may be silently dropped.

Implemented in openPMD::chunk_assignment::ByHostname, and PyPartialStrategy.


The documentation for this struct was generated from the following files: