hpx/collectives/spmd_block.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace lcos

Functions

template<typename F, typename ...Args>
hpx::future<void> define_spmd_block(std::string &&name, std::size_t images_per_locality, F&&, Args&&... args)
struct spmd_block
#include <spmd_block.hpp>

The class spmd_block defines an interface for launching multiple images while giving handles to each image to interact with the remaining images. The define_spmd_block function templates create multiple images of a user-defined action and launches them in a possibly separate thread. A temporary spmd block object is created and diffused to each image. The constraint for the action given to the define_spmd_block function is to accept a spmd_block as first parameter.

Public Functions

spmd_block()
spmd_block(std::string const &name, std::size_t images_per_locality, std::size_t num_images, std::size_t image_id)
std::size_t get_images_per_locality() const
std::size_t get_num_images() const
std::size_t this_image() const
void sync_all() const
hpx::future<void> sync_all(hpx::launch::async_policy const&) const
void sync_images(std::set<std::size_t> const &images) const
void sync_images(std::vector<std::size_t> const &input_images) const
template<typename Iterator>
std::enable_if<traits::is_input_iterator<Iterator>::value>::type sync_images(Iterator begin, Iterator end) const
template<typename ...I>
std::enable_if<util::all_of<typename std::is_integral<I>::type...>::value>::type sync_images(I... i)
hpx::future<void> sync_images(hpx::launch::async_policy const&, std::set<std::size_t> const &images) const
hpx::future<void> sync_images(hpx::launch::async_policy const &policy, std::vector<std::size_t> const &input_images) const
template<typename Iterator>
std::enable_if<traits::is_input_iterator<Iterator>::value, hpx::future<void>>::type sync_images(hpx::launch::async_policy const &policy, Iterator begin, Iterator end) const
template<typename ...I>
std::enable_if<util::all_of<typename std::is_integral<I>::type...>::value, hpx::future<void>>::type sync_images(hpx::launch::async_policy const &policy, I... i) const

Private Types

using barrier_type = hpx::distributed::barrier
using table_type = std::map<std::set<std::size_t>, std::shared_ptr<barrier_type>>

Private Functions

template<typename Archive>
void serialize(Archive&, unsigned)

Private Members

std::string name_
std::size_t images_per_locality_
std::size_t num_images_
std::size_t image_id_
hpx::util::jenkins_hash hash_
std::shared_ptr<hpx::distributed::barrier> barrier_
table_type barriers_

Friends

friend hpx::lcos::hpx::serialization::access