You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code worked on one node but failed on two nodes. See the error message reproduced below.
Also, I have a similar code example with the same runtime error--except in that example, an action is called, hpx::apply(action_name, hpx::colocated(id_of_correct_partition), local_iter_beg, local_iter_end), for each partition instead of by calling hpx::parallel::generate.
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/include/parallel_generate.hpp>
#include <hpx/include/partitioned_vector.hpp>
#include <boost/random.hpp>
///////////////////////////////////////////////////////////////////////////////
// Define the vector types to be used.
HPX_REGISTER_PARTITIONED_VECTOR(int);
///////////////////////////////////////////////////////////////////////////////
struct random_fill
{
random_fill()
: gen(std::rand()),
dist(0, RAND_MAX)
{}
int operator()()
{
return dist(gen);
}
boost::random::mt19937 gen;
boost::random::uniform_int_distribution<> dist;
template <typename Archive>
void serialize(Archive& ar, unsigned)
{}
};
///////////////////////////////////////////////////////////////////////////////
int hpx_main(boost::program_options::variables_map& vm)
{
if (hpx::get_locality_id() == 0)
{
// create as many partitions as we have localities
std::size_t size = 10000;
hpx::partitioned_vector<int> v(
size, hpx::container_layout(hpx::find_all_localities()));
// initialize data
// segmented version of algorithm used
using namespace hpx::parallel;
generate(par, v.begin(), v.end(), random_fill());
return hpx::finalize();
}
return 0;
}
int main()
{
return hpx::init();
}
The following code worked on one node but failed on two nodes. See the error message reproduced below.
Also, I have a similar code example with the same runtime error--except in that example, an action is called, hpx::apply(action_name, hpx::colocated(id_of_correct_partition), local_iter_beg, local_iter_end), for each partition instead of by calling hpx::parallel::generate.
The error message:
The text was updated successfully, but these errors were encountered: