Interfaces¶
template< typename tPrimitive >
void BSPLib::Get( uint32_t pid, tPrimitive &src, tPrimitive &dst ) // (1) References
template<>
void BSPLib::Get( uint32_t pid, std::string &src, std::string &dst ) // (2) std::string
template< typename tPrimitive >
void BSPLib::Get( uint32_t pid, tPrimitive &var ) // (3) Reference
This operation get the registered primitive of another processor and copies the
memory into its own memory. It gets the primitive stored in src
that
is located in the processor with ID pid
and stores it at the location of dst
.
Internally, it calculates the size in bytes that is required for the primitive,
and calls to BSPLib::Classic::Get()
.
- Gets the value from
src
in the processor with IDpid
and stores it indst
, using references. - Overload for
std::string
. - Get the value from
var
in the processor with IDpid
and stores it invar
, the same reference.
Tip
There are also other specialisations available. See Containers, Primitives and Pointers.
Warnings
- In case of (2), the destination
std::string
must be at least as big as the sourcestd::string
. Make sure it is correctly resized, either by deciding on a fixed size, or communicating the size beforehand.
Parameters¶
pid
The identifier of the processor to communicate with.src
Reference to the source of the information in the other processor.dst
Reference to the destination for the information in the current processor.var
Reference to both the source of the in the other processor, and the destination for the information in the current processor.
Pre-Conditions¶
BSPLib::Begin()
has been called.BSPLib::Push()
has been called onsrc
in the processor with IDpid
.- A
BSPLib::Sync()
has happened betweenBSPLig::Push()
and this call. - In case of (2), the
dst
string is at least as big as thesrc
string.
Post-Conditions¶
- Get request has been queued.
- In the next superstep
BSPLib::Sync()
, the destination will have the copied value from the source.