Skip to content

Commit

Permalink
Merge pull request #3024 from STEllAR-GROUP/inspect-fixes
Browse files Browse the repository at this point in the history
Inspect fixes
  • Loading branch information
hkaiser committed Nov 26, 2017
2 parents 7efddcc + 6a37186 commit b3dbbcb
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 99 deletions.
3 changes: 2 additions & 1 deletion cmake/templates/config_defines.hpp.in
Expand Up @@ -16,7 +16,8 @@
#define HPX_PREFIX "@HPX_DEFINES_PREFIX@"
#endif
@hpx_config_defines@
#if defined(HPX_HAVE_MAX_CPU_COUNT) && (HPX_HAVE_MAX_CPU_COUNT > 64) && !defined(HPX_HAVE_MORE_THAN_64_THREADS)
#if defined(HPX_HAVE_MAX_CPU_COUNT) && (HPX_HAVE_MAX_CPU_COUNT > 64) && \
!defined(HPX_HAVE_MORE_THAN_64_THREADS)
#define HPX_HAVE_MORE_THAN_64_THREADS
#endif

Expand Down
2 changes: 2 additions & 0 deletions cmake/templates/static_parcelports.hpp.in
Expand Up @@ -10,6 +10,8 @@

#include <hpx/util/assert.hpp>

#include <vector>

@_parcelport_export@
namespace hpx { namespace parcelset
{
Expand Down
4 changes: 2 additions & 2 deletions cmake/tests/cxx14_return_type_deduction.cpp
Expand Up @@ -5,7 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
////////////////////////////////////////////////////////////////////////////////

auto check(int a, int b)
auto check1(int a, int b)
{
int c = a + b;
return c;
Expand All @@ -24,7 +24,7 @@ int main()
{
int a = 10;
int b = 20;
check(a, b);
check1(a, b);
double c = check2(30.0);
}

4 changes: 2 additions & 2 deletions examples/quickstart/composable_guard.cpp
Expand Up @@ -57,7 +57,7 @@ void both() {

int increments = 3000;

void check() {
void check_() {
if(2*increments == i1 && 2*increments == i2) {
std::cout << "Test passed" << std::endl;
} else {
Expand All @@ -80,7 +80,7 @@ int hpx_main(boost::program_options::variables_map& vm) {
run_guarded(*l2,incr2);
}

run_guarded(guards,check);
run_guarded(guards,check_);
return hpx::finalize();
}

Expand Down
6 changes: 3 additions & 3 deletions hpx/lcos/local/composable_guard.hpp
Expand Up @@ -109,16 +109,16 @@ namespace hpx { namespace lcos { namespace local
{}

~debug_object() {
check();
check_();
magic = ~debug_magic;
}

void check() {
void check_() {
HPX_ASSERT(magic != ~debug_magic);
HPX_ASSERT(magic == debug_magic);
}
#else
void check() {}
void check_() {}
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion hpx/plugins/parcelport/mpi/sender_connection.hpp
Expand Up @@ -90,7 +90,7 @@ namespace hpx { namespace parcelset { namespace policies { namespace mpi
return there_;
}

void verify(parcelset::locality const & parcel_locality_id) const
void verify_(parcelset::locality const & parcel_locality_id) const
{
}

Expand Down
2 changes: 1 addition & 1 deletion hpx/plugins/parcelport/tcp/sender.hpp
Expand Up @@ -74,7 +74,7 @@ namespace hpx { namespace parcelset { namespace policies { namespace tcp
return there_;
}

void verify(parcelset::locality const & parcel_locality_id) const
void verify_(parcelset::locality const & parcel_locality_id) const
{
#if defined(HPX_DEBUG)
boost::system::error_code ec;
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/parcelset/parcelport_impl.hpp
Expand Up @@ -883,7 +883,7 @@ namespace hpx { namespace parcelset
#if defined(HPX_DEBUG)
// verify the connection points to the right destination
// HPX_ASSERT(parcel_locality_id == sender_connection->destination());
sender_connection->verify(parcel_locality_id);
sender_connection->verify_(parcel_locality_id);
#endif
// encode the parcels
std::size_t num_parcels = encode_parcels(*this, &parcels[0],
Expand Down
13 changes: 7 additions & 6 deletions hpx/runtime/threads/coroutines/detail/context_posix.hpp
Expand Up @@ -69,7 +69,7 @@
namespace hpx { namespace threads { namespace coroutines { namespace detail {
namespace posix { namespace pth
{
inline int check(int rc)
inline int check_(int rc)
{
// The makecontext() functions return zero for success, nonzero for
// error. The Pth library returns TRUE for success, FALSE for error,
Expand All @@ -83,16 +83,17 @@ namespace posix { namespace pth
#define HPX_COROUTINE_POSIX_IMPL "Pth implementation"
#define HPX_COROUTINE_DECLARE_CONTEXT(name) pth_uctx_t name
#define HPX_COROUTINE_CREATE_CONTEXT(ctx) \
hpx::threads::coroutines::detail::posix::pth::check(pth_uctx_create(&(ctx)))
hpx::threads::coroutines::detail::posix::pth::check_(pth_uctx_create(&(ctx)))
#define HPX_COROUTINE_MAKE_CONTEXT(ctx, stack, size, startfunc, startarg, exitto) \
/* const sigset_t* sigmask = nullptr: we don't expect per-context signal masks */ \
hpx::threads::coroutines::detail::posix::pth::check( \
pth_uctx_make(*(ctx), static_cast<char*>(stack), (size), nullptr, \
hpx::threads::coroutines::detail::posix::pth::check_( \
pth_uctx_make(*(ctx), static_cast<char*>(stack), (size), nullptr, \
(startfunc), (startarg), (exitto)))
#define HPX_COROUTINE_SWAP_CONTEXT(from, to) \
hpx::threads::coroutines::detail::posix::pth::check(pth_uctx_switch(*(from), *(to)))
hpx::threads::coroutines::detail::posix::pth::check_( \
pth_uctx_switch(*(from), *(to))) \
#define HPX_COROUTINE_DESTROY_CONTEXT(ctx) \
hpx::threads::coroutines::detail::posix::pth::check(pth_uctx_destroy(ctx))
hpx::threads::coroutines::detail::posix::pth::check_(pth_uctx_destroy(ctx))

#else // generic Posix platform (e.g. OS X >= 10.5)

Expand Down
10 changes: 5 additions & 5 deletions hpx/util/lightweight_test.hpp
Expand Up @@ -64,7 +64,7 @@ struct fixture
std::size_t get(counter_type c) const;

template <typename T>
bool check(char const* file, int line, char const* function,
bool check_(char const* file, int line, char const* function,
counter_type c, T const& t, char const* msg)
{
if (!t)
Expand Down Expand Up @@ -209,14 +209,14 @@ inline int report_errors(std::ostream& stream = std::cerr)
}} // hpx::util

#define HPX_TEST(expr) \
::hpx::util::detail::global_fixture.check \
::hpx::util::detail::global_fixture.check_ \
(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, \
::hpx::util::counter_test, \
expr, "test '" HPX_PP_STRINGIZE(expr) "'") \
/***/

#define HPX_TEST_MSG(expr, msg) \
::hpx::util::detail::global_fixture.check \
::hpx::util::detail::global_fixture.check_ \
(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, \
::hpx::util::counter_test, \
expr, msg) \
Expand Down Expand Up @@ -278,14 +278,14 @@ inline int report_errors(std::ostream& stream = std::cerr)
/***/

#define HPX_SANITY(expr) \
::hpx::util::detail::global_fixture.check \
::hpx::util::detail::global_fixture.check_ \
(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, \
::hpx::util::counter_sanity, \
expr, "sanity check '" HPX_PP_STRINGIZE(expr) "'") \
/***/

#define HPX_SANITY_MSG(expr, msg) \
::hpx::util::detail::global_fixture.check \
::hpx::util::detail::global_fixture.check_ \
(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, \
::hpx::util::counter_sanity, \
expr, msg) \
Expand Down
4 changes: 3 additions & 1 deletion plugins/parcelport/CMakeLists.txt
Expand Up @@ -106,7 +106,9 @@ macro(add_parcelport_modules)
set(_parcelport_init)
foreach(parcelport ${HPX_STATIC_PARCELPORT_PLUGINS})
set(_parcelport_export
"${_parcelport_export}HPX_EXPORT hpx::plugins::parcelport_factory_base *parcelport_${parcelport}_factory_init(std::vector<hpx::plugins::parcelport_factory_base *>& factories);\n")
"${_parcelport_export}HPX_EXPORT hpx::plugins::parcelport_factory_base *parcelport_${parcelport}_factory_init(\n")
set(_parcelport_export
"${_parcelport_export} std::vector<hpx::plugins::parcelport_factory_base *>& factories);\n")
set(_parcelport_init
"${_parcelport_init} parcelport_${parcelport}_factory_init(factories);\n")
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion plugins/parcelport/libfabric/sender.hpp
Expand Up @@ -95,7 +95,7 @@ namespace libfabric

// --------------------------------------------------------------------
// @TODO: unused, but required by the parcelport interface
void verify(parcelset::locality const & parcel_locality_id) const {}
void verify_(parcelset::locality const & parcel_locality_id) const {}

// --------------------------------------------------------------------
// The main message send routine : package the header, send it
Expand Down
2 changes: 1 addition & 1 deletion plugins/parcelport/verbs/sender_connection.hpp
Expand Up @@ -62,7 +62,7 @@ namespace verbs
return snd_buffer_type(snd_data_type(chunk_pool_), chunk_pool_);
}

void verify(parcelset::locality const & parcel_locality_id) const
void verify_(parcelset::locality const & parcel_locality_id) const
{
}

Expand Down
16 changes: 8 additions & 8 deletions src/lcos/local/composable_guard.cpp
Expand Up @@ -43,7 +43,7 @@ namespace hpx { namespace lcos { namespace local
{
if (task == nullptr)
return;
task->check();
task->check_();
delete task;
}
}
Expand All @@ -52,7 +52,7 @@ namespace hpx { namespace lcos { namespace local
{
if (!sorted) {
std::sort(guards.begin(), guards.end());
(*guards.begin())->check();
(*guards.begin())->check_();
sorted = true;
}
}
Expand Down Expand Up @@ -88,10 +88,10 @@ namespace hpx { namespace lcos { namespace local
static void run_guarded(guard& g, detail::guard_task* task)
{
HPX_ASSERT(task != nullptr);
task->check();
task->check_();
detail::guard_task* prev = g.task.exchange(task);
if (prev != nullptr) {
prev->check();
prev->check_();
detail::guard_task* zero = nullptr;
if (!prev->next.compare_exchange_strong(zero, task)) {
run_composable(task);
Expand All @@ -115,7 +115,7 @@ namespace hpx { namespace lcos { namespace local
// continue processing.
for (std::size_t k=0; k<n; k++) {
detail::guard_task* lt = sd->stages[k];
lt->check();
lt->check_();
HPX_ASSERT(!lt->single_guard);
zero = nullptr;
if (!lt->next.compare_exchange_strong(zero, lt)) {
Expand Down Expand Up @@ -151,7 +151,7 @@ namespace hpx { namespace lcos { namespace local
return;
} else if (n == 1) {
run_guarded(*guards.guards[0], std::move(task));
guards.check();
guards.check_();
return;
}
guards.sort();
Expand Down Expand Up @@ -185,7 +185,7 @@ namespace hpx { namespace lcos { namespace local
// the next field, we halt processing on items queued
// to this guard.
HPX_ASSERT(task != nullptr);
task->check();
task->check_();
if (!task->next.compare_exchange_strong(zero, task)) {
HPX_ASSERT(zero != nullptr);
run_composable(zero);
Expand All @@ -202,7 +202,7 @@ namespace hpx { namespace lcos { namespace local
if(task == empty)
return;
HPX_ASSERT(task != nullptr);
task->check();
task->check_();
if (task->single_guard) {
run_composable_cleanup rcc(task);
task->run();
Expand Down
2 changes: 1 addition & 1 deletion tests/performance/local/foreach_scaling.cpp
Expand Up @@ -149,7 +149,7 @@ int hpx_main(boost::program_options::variables_map& vm)
chunk_size = vm["chunk_size"].as<int>();
num_overlapping_loops = vm["overlapping_loops"].as<int>();

//verify that input is within domain of program
// verify that input is within domain of program
if(test_count == 0 || test_count < 0) {
hpx::cout << "test_count cannot be zero or negative...\n" << hpx::flush;
} else if (delay < 0) {
Expand Down
Expand Up @@ -58,7 +58,7 @@ int hpx_main(boost::program_options::variables_map&)
}

///////////////////////////////////////////////////////////////////////////////
int check(int fd)
int check_(int fd)
{
std::string out;
std::vector<double> cnt;
Expand Down Expand Up @@ -140,7 +140,7 @@ int main(int argc, char* argv[])
hpx::start(argc+1, opt);

// Collect and process the output.
int rc = check(pipefd[0]);
int rc = check_(pipefd[0]);

hpx::stop();
return rc;
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/lcos/run_guarded.cpp
Expand Up @@ -45,7 +45,7 @@ void both() {
int increments = 3000;


void check()
void check_()
{
HPX_TEST(2*increments == i1 && 2*increments == i2);
}
Expand All @@ -65,7 +65,7 @@ int hpx_main(boost::program_options::variables_map& vm) {
run_guarded(*l2,incr2);
}

run_guarded(guards, &::check);
run_guarded(guards, &::check_);
return hpx::finalize();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/parallel/algorithms/sort.cpp
Expand Up @@ -35,7 +35,7 @@ void sort_benchmark()
hpx::parallel::sort(execution::par, c.begin(), c.end());
double elapsed = t.elapsed();

bool is_sorted = (verify(c, std::less<double>(), elapsed, true)!=0);
bool is_sorted = (verify_(c, std::less<double>(), elapsed, true)!=0);
HPX_TEST(is_sorted);
if (is_sorted) {
std::cout << "<DartMeasurement name=\"SortDoublesTime\" \n"
Expand Down

0 comments on commit b3dbbcb

Please sign in to comment.