Permalink
Browse files

Merge pull request #3454 from STEllAR-GROUP/fixing_warnings

Fixing warnings related to silent conversion of size_t --> int16_t
  • Loading branch information...
msimberg committed Sep 12, 2018
2 parents 3995ea9 + 1f3396a commit a45002888a7b19a5886407d2d37631f88311de38
@@ -24,6 +24,7 @@
#include <boost/intrusive_ptr.hpp>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <type_traits>
#include <utility>
@@ -104,14 +105,16 @@ namespace hpx { namespace lcos { namespace local
typedef typename Base::future_base_type future_base_type;
future_base_type this_(this);
if (policy == launch::fork) {
if (policy == launch::fork)
{
return threads::register_thread_nullary(
util::deferred_call(
&base_type::run_impl, std::move(this_)),
util::thread_description(f_, "task_object::apply"),
threads::pending_do_not_schedule, true,
threads::thread_priority_boost,
threads::thread_schedule_hint(get_worker_thread_num()),
threads::thread_schedule_hint(
static_cast<std::int16_t>(get_worker_thread_num())),
stacksize, ec);
}
@@ -221,7 +221,8 @@ namespace hpx { namespace parcelset
"schedule_parcel",
threads::pending, true,
threads::thread_priority_boost,
threads::thread_schedule_hint(num_thread),
threads::thread_schedule_hint(
static_cast<std::int16_t>(num_thread)),
threads::thread_stacksize_default);
}
// If we are the first deferred parcel, we don't need to spin
@@ -145,20 +145,20 @@ namespace hpx { namespace parcelset
}
}
~parcelport_impl()
~parcelport_impl() override
{
connection_cache_.clear();
}
bool can_bootstrap() const
bool can_bootstrap() const override
{
return
connection_handler_traits<
ConnectionHandler
>::send_early_parcel::value;
}
bool run(bool blocking = true)
bool run(bool blocking = true) override
{
io_service_pool_.run(false); // start pool
@@ -170,7 +170,7 @@ namespace hpx { namespace parcelset
return success;
}
void flush_parcels()
void flush_parcels() override
{
// We suspend our thread, which will make progress on the network
if(threads::get_self_ptr())
@@ -192,7 +192,7 @@ namespace hpx { namespace parcelset
}
}
void stop(bool blocking = true)
void stop(bool blocking = true) override
{
flush_parcels();
@@ -208,7 +208,8 @@ namespace hpx { namespace parcelset
}
public:
void put_parcel(locality const & dest, parcel p, write_handler_type f)
void put_parcel(
locality const& dest, parcel p, write_handler_type f) override
{
HPX_ASSERT(dest.type() == type());
@@ -237,7 +238,7 @@ namespace hpx { namespace parcelset
}
void put_parcels(locality const& dest, std::vector<parcel> parcels,
std::vector<write_handler_type> handlers)
std::vector<write_handler_type> handlers) override
{
if (parcels.size() != handlers.size())
{
@@ -282,19 +283,19 @@ namespace hpx { namespace parcelset
});
}
void send_early_parcel(locality const & dest, parcel p)
void send_early_parcel(locality const & dest, parcel p) override
{
send_early_parcel_impl<ConnectionHandler>(dest, std::move(p));
}
util::io_service_pool* get_thread_pool(char const* name)
util::io_service_pool* get_thread_pool(char const* name) override
{
if (0 == std::strcmp(name, io_service_pool_.get_name()))
return &io_service_pool_;
return nullptr;
}
bool do_background_work(std::size_t num_thread)
bool do_background_work(std::size_t num_thread) override
{
trigger_pending_work();
return do_background_work_impl<ConnectionHandler>(num_thread);
@@ -325,7 +326,8 @@ namespace hpx { namespace parcelset
this, loc),
"remove_from_connection_cache_delayed",
threads::pending, true, threads::thread_priority_normal,
threads::thread_schedule_hint(get_next_num_thread()),
threads::thread_schedule_hint(
static_cast<std::int16_t>(get_next_num_thread())),
threads::thread_stacksize_default,
ec);
if (!ec) return;
@@ -334,7 +336,7 @@ namespace hpx { namespace parcelset
connection_cache_.clear(loc);
}
void remove_from_connection_cache(locality const& loc)
void remove_from_connection_cache(locality const& loc) override
{
error_code ec(lightweight);
threads::thread_id_type id =
@@ -344,7 +346,8 @@ namespace hpx { namespace parcelset
this, loc),
"remove_from_connection_cache",
threads::suspended, true, threads::thread_priority_normal,
threads::thread_schedule_hint(get_next_num_thread()),
threads::thread_schedule_hint(
static_cast<std::int16_t>(get_next_num_thread())),
threads::thread_stacksize_default,
ec);
if (ec) return;
@@ -355,15 +358,15 @@ namespace hpx { namespace parcelset
}
/// Return the name of this locality
std::string get_locality_name() const
std::string get_locality_name() const override
{
return connection_handler().get_locality_name();
}
////////////////////////////////////////////////////////////////////////
// Return the given connection cache statistic
std::int64_t get_connection_cache_statistics(
connection_cache_statistics_type t, bool reset)
connection_cache_statistics_type t, bool reset) override
{
switch (t) {
case connection_cache_insertions:
@@ -156,15 +156,22 @@ namespace hpx { namespace threads
};
///////////////////////////////////////////////////////////////////////////
struct thread_schedule_hint {
thread_schedule_hint() : mode(thread_schedule_hint_mode_none),
hint(-1) {}
struct thread_schedule_hint
{
thread_schedule_hint()
: mode(thread_schedule_hint_mode_none)
, hint(-1)
{}
thread_schedule_hint(std::int16_t thread_hint)
: mode(thread_schedule_hint_mode_thread), hint(thread_hint) {}
: mode(thread_schedule_hint_mode_thread)
, hint(thread_hint)
{}
thread_schedule_hint(thread_schedule_hint_mode mode, std::int16_t hint)
: mode(mode), hint(hint) {}
: mode(mode)
, hint(hint)
{}
thread_schedule_hint_mode mode;
std::int16_t hint;

0 comments on commit a450028

Please sign in to comment.