Skip to content

Commit

Permalink
Fixing recent changes to vector which were making registration explicit
Browse files Browse the repository at this point in the history
(cherry picked from commit 2b49d1b)
  • Loading branch information
hkaiser committed Mar 3, 2015
1 parent 79895b4 commit 043f1ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions hpx/components/containers/vector/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ namespace hpx
return this->base_type::connect_to(symbolic_name,
util::bind(&vector::connect_to_helper, this, _1));
}
void connect_to_sync(std::string const& symbolic_name)
{
connect_to(symbolic_name).get();
}

// Register this vector with AGAS using the given symbolic name
future<void> register_as(std::string const& symbolic_name)
Expand All @@ -323,6 +327,10 @@ namespace hpx
registered_name_ = symbolic_name;
return this->base_type::register_as(symbolic_name);
}
void register_as_sync(std::string const& symbolic_name)
{
register_as(symbolic_name).get();
}

public:
// Return the sequence number of the segment corresponding to the
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/components/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ void trivial_test_without_policy(std::size_t size, char const* prefix)
std::string empty(prefix_ + "empty");

hpx::vector<T> base;
base.register_as(empty);
base.register_as_sync(empty);

hpx::vector<T> v;
v.connect_to(empty);
v.connect_to_sync(empty);

test_global_iteration(v, 0, T());
test_segmented_iteration(v, 0, 0);
Expand All @@ -270,10 +270,10 @@ void trivial_test_without_policy(std::size_t size, char const* prefix)
std::string size_(prefix_ + "size");

hpx::vector<T> base(size);
base.register_as(size_);
base.register_as_sync(size_);

hpx::vector<T> v;
v.connect_to(size_);
v.connect_to_sync(size_);

test_global_iteration(v, size, T());
test_segmented_iteration(v, size, 1);
Expand All @@ -292,10 +292,10 @@ void trivial_test_without_policy(std::size_t size, char const* prefix)
std::string size_value(prefix_ + "size_value");

hpx::vector<T> base(size, T(999));
base.register_as(size_value);
base.register_as_sync(size_value);

hpx::vector<T> v;
v.connect_to(size_value);
v.connect_to_sync(size_value);

test_global_iteration(v, size, T(999));
test_segmented_iteration(v, size, 1);
Expand All @@ -319,10 +319,10 @@ void trivial_test_with_policy(std::size_t size, std::size_t parts,
std::string policy_(prefix_ + "policy");

hpx::vector<T> base(size, policy);
base.register_as(policy_);
base.register_as_sync(policy_);

hpx::vector<T> v;
v.connect_to(policy_);
v.connect_to_sync(policy_);

test_global_iteration(v, size, T(0));
test_segmented_iteration(v, size, parts);
Expand All @@ -339,10 +339,10 @@ void trivial_test_with_policy(std::size_t size, std::size_t parts,
std::string policy_value(prefix_ + "policy_value");

hpx::vector<T> base(size, T(999), policy);
base.register_as(policy_value);
base.register_as_sync(policy_value);

hpx::vector<T> v;
v.connect_to(policy_value);
v.connect_to_sync(policy_value);

test_global_iteration(v, size, T(999));
test_segmented_iteration(v, size, parts);
Expand Down

0 comments on commit 043f1ad

Please sign in to comment.