Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple of examples that failed to compile after recent api changes #2343

Merged
merged 1 commit into from Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/1d_stencil/1d_stencil_4_repart.cpp
Expand Up @@ -57,9 +57,9 @@ void setup_counters() {
// We need to explicitly start all counters before we can use them. For
// certain counters this could be a no-op, in which case start will return
// 'false'.
performance_counter::start(id);
performance_counter::start(hpx::launch::sync, id);
std::cout << "Counter " << counter_name << " initialized " << id << std::endl;
counter_value value = performance_counter::get_value(id);
counter_value value = performance_counter::get_value(hpx::launch::sync, id);
std::cout << "Counter value " << value.get_value<std::int64_t>() << std::endl;
counter_id = id;
end_iteration_event = apex::register_custom_event("Repartition");
Expand All @@ -80,7 +80,8 @@ double get_counter_value() {
return false;
}
try {
counter_value value1 = performance_counter::get_value(counter_id, true);
counter_value value1 =
performance_counter::get_value(hpx::launch::sync, counter_id, true);
std::int64_t counter_value = value1.get_value<std::int64_t>();
std::cerr << "counter_value " << counter_value << std::endl;
return (double)(counter_value);
Expand Down
7 changes: 4 additions & 3 deletions examples/1d_stencil/1d_stencil_4_throttle.cpp
Expand Up @@ -60,9 +60,9 @@ void setup_counters() {
// We need to explicitly start all counters before we can use them. For
// certain counters this could be a no-op, in which case start will return
// 'false'.
performance_counter::start(id);
performance_counter::start(hpx::launch::sync, id);
std::cout << "Counters initialized! " << id << std::endl;
counter_value value = performance_counter::get_value(id);
counter_value value = performance_counter::get_value(hpx::launch::sync, id);
std::cout << "Active threads " << value.get_value<int>() << std::endl;
counter_id = id;
}
Expand All @@ -77,7 +77,8 @@ void setup_counters() {
bool test_function(apex_context const& context) {
if (!counters_initialized) return false;
try {
counter_value value1 = performance_counter::get_value(counter_id);
counter_value value1 =
performance_counter::get_value(hpx::launch::sync, counter_id);
apex::sample_value("thread_queue_length", value1.get_value<int>());
return APEX_NOERROR;
}
Expand Down
7 changes: 4 additions & 3 deletions examples/apex/apex_policy_engine_active_thread_count.cpp
Expand Up @@ -79,9 +79,9 @@ void setup_counters() {
// We need to explicitly start all counters before we can use them. For
// certain counters this could be a no-op, in which case start will
// return 'false'.
performance_counter::start(id);
performance_counter::start(hpx::launch::sync, id);
std::cout << "Counters initialized! " << id << std::endl;
counter_value value = performance_counter::get_value(id);
counter_value value = performance_counter::get_value(hpx::launch::sync, id);
std::cout << "Active threads " << value.get_value<int>() << std::endl;
counter_id = id;
}
Expand Down Expand Up @@ -117,7 +117,8 @@ bool test_function(apex_context const& context) {
if (!counters_initialized) return false;
try {
//id_type id = get_counter_id();
counter_value value1 = performance_counter::get_value(counter_id);
counter_value value1 =
performance_counter::get_value(hpx::launch::sync, counter_id);
if (value1.get_value<int>() % 2 == 1) {
return APEX_NOERROR;
} else {
Expand Down
Expand Up @@ -34,7 +34,7 @@ int hpx_main(boost::program_options::variables_map&)

id_type id = get_counter(boost::str(cnt_name % prefix));

performance_counter::start(id);
performance_counter::start(hpx::launch::sync, id);

// perform n ops, active counter
volatile size_t i;
Expand All @@ -43,13 +43,13 @@ int hpx_main(boost::program_options::variables_map&)

counter_value value1 = performance_counter::get_value(hpx::launch::sync, id);
// stop the counter w/o resetting
performance_counter::stop(id);
performance_counter::stop(hpx::launch::sync,id);

// perform n ops (should be uncounted)
for (i = 0; i < n; i++) a=b+c;
// get value and reset, and start again
counter_value value2 = performance_counter::get_value(hpx::launch::sync, id, true);
performance_counter::start(id);
performance_counter::start(hpx::launch::sync, id);

// perform 2*n ops, counted from 0 (or close to it)
for (i = 0; i < 2*n; i++) a=b+c;
Expand Down