void BSPLib::Push( const void *ident, size_t byteSize ) // (1) Modern void BSPLib::Push() // (2) Padding template< typename tPrimitive > void BSPLib::Push( tPrimitive &identRef ) // (3) Reference template<> void BSPLib::Push( std::string &stringRef ) // (4) std::string template< typename tPrimitive > void BSPLib::PushPtrs( tPrimitive *begin, size_t count ) // (5) Primitive pointer template< typename tPrimitive > void BSPLib::PushPtrs( tPrimitive *begin, tPrimitive *end ) // (6) Primitive pointers template < typename tIterator> void BSPLib::PushIterator( tIterator beginIt, size_t count ) // (7) Iterator template < typename tIterator> void BSPLib::PushIterator( tIterator beginIt, tIterator endIt ) // (8) Iterators template< typename tPrimitive, size_t tSize > void BSPLib::PushCArray( tPrimitive( &cArray )[tSize] ) // (9) C-Array template< typename tContainer > void BSPLib::PushContainer( tContainer &container ) // (10) Container void BSPLib::Classic::Push( const void *ident, size_t byteSize ) // (11) Classic void bsp_pushreg( const void *ident, size_t byteSize ) // (12) BSP
Pushes a register, with the given size. BSPLib can have communication with any
contiguous data type. To ensure this requirement, the library needs to know what
addresses are available for communication. To recognise addresses of other
processors, the order of registration and deregistration
needs to be the same in each processor. When one processor does not need to register
an address, a
nullptrcan be pushed, or the specialised function (2) can be used.
Each push should be accompanied by a pop, or is assumed to be popped at the end of
the BSP program.
- Modern interface of the classic BSP function.
- Adds padding if the current processor does not need to push.
- Pushes a primitive as register. Computes the bytesize internally.
- Template specialisation for
- Pushes the address of
begin, with bytesize
count * sizeof(tPrimitive).
- Pushes all addresses from
end. Computes the bytesize internally.
- Pushes the address of the
beginItiterator up to
- Pushes all addresses from
endIt. Computes the bytesize internally.
- Pushes all addresses of the C-Array, with bytesize
tSize * sizeof(tPrimitive).
- Pushes all addresses of the container, with bytesize
container.size() * sizeof(tContainer::value_type).
- Classic BSP function.
- Legacy BSP function.
- In case of (4), the std::string must not be resized. If a resize is absolutely necessary, it should be done before pushing the register, or after popping the register. Also, make sure the processors agree on the size beforehand.
- In case of (7), (8) and (10), make sure the iterators describe contiguous memory, and are not invalidated (due to resizes).
BSPLib::Push()is called after
BSPLib::Pop(), the register that has been popped will not be replaced by the new register, as the naming might suggest.
In the current implementation, the pointer to the top of the registration stack is never lowered. In the programs we tested until now, this has not been a problem. We might change this behaviour in the future. In case we do, no changes will be needed in existing BSP programs. The stack is always cleared when a new BSP program is initialised.
identThe address to register.
byteSizeThe size in bytes of the address space.
identRefReference to the variable to register.
stringRefReference to the string to regiser.
beginBegin of the address space to register.
countNumber of addresses to register in the current space.
endEnd of the address space to register.
beginItIterator describing the begin of the address space to register.
endItIterator describing the end of the address space to register.
cArrayC-Array of which we register all addresses.
containerContainer of which we register all addresses.
BSPLib::Classic::Begin()has been called.
- Push request has been queued.
- In the next superstep, this register will be available for