diff --git a/hpx/runtime/parcelset/parcelport.hpp b/hpx/runtime/parcelset/parcelport.hpp index 859d1b65adf5..284ab68153dc 100644 --- a/hpx/runtime/parcelset/parcelport.hpp +++ b/hpx/runtime/parcelset/parcelport.hpp @@ -28,6 +28,12 @@ #include +#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#define HPX_PARCELSET_PENDING_PARCELS_WORKAROUND +#elif defined(HPX_GCC_VERSION) && HPX_GCC_VERSION < 40700 +#define HPX_PARCELSET_PENDING_PARCELS_WORKAROUND +#endif + /////////////////////////////////////////////////////////////////////////////// namespace hpx { namespace agas { @@ -359,7 +365,7 @@ namespace hpx { namespace parcelset /// The cache for pending parcels typedef std::list new_gids_type; typedef std::map new_gids_map; -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) typedef util::tuple< boost::shared_ptr > , std::vector diff --git a/hpx/runtime/parcelset/parcelport_impl.hpp b/hpx/runtime/parcelset/parcelport_impl.hpp index aea126acdbbe..65818af0a332 100644 --- a/hpx/runtime/parcelset/parcelport_impl.hpp +++ b/hpx/runtime/parcelset/parcelport_impl.hpp @@ -572,7 +572,7 @@ namespace hpx { namespace parcelset > il(&l); mapped_type& e = pending_parcels_[locality_id]; -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) if(!util::get<0>(e)) util::get<0>(e) = boost::make_shared >(); util::get<0>(e)->push_back(std::move(p)); @@ -603,7 +603,7 @@ namespace hpx { namespace parcelset HPX_ASSERT(parcels.size() == handlers.size()); mapped_type& e = pending_parcels_[locality_id]; -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) if(!util::get<0>(e)) { util::get<0>(e) = boost::make_shared >(); @@ -631,7 +631,7 @@ namespace hpx { namespace parcelset #endif else { -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) HPX_ASSERT(util::get<0>(e)->size() == util::get<1>(e).size()); std::size_t new_size = util::get<0>(e)->size() + parcels.size(); util::get<0>(e)->reserve(new_size); @@ -673,7 +673,7 @@ namespace hpx { namespace parcelset // do nothing if parcels have already been picked up by // another thread -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) if (it != pending_parcels_.end() && !util::get<0>(it->second)->empty()) #else if (it != pending_parcels_.end() && !util::get<0>(it->second).empty()) @@ -681,7 +681,7 @@ namespace hpx { namespace parcelset { HPX_ASSERT(it->first == locality_id); HPX_ASSERT(handlers.size() == parcels.size()); -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) std::swap(parcels, *util::get<0>(it->second)); #else std::swap(parcels, util::get<0>(it->second)); @@ -854,7 +854,7 @@ namespace hpx { namespace parcelset HPX_ASSERT(locality_id == sender_connection->destination()); pending_parcels_map::iterator it = pending_parcels_.find(locality_id); -#if defined(HPX_INTEL_VERSION) && HPX_INTEL_VERSION < 1400 +#if defined(HPX_PARCELSET_PENDING_PARCELS_WORKAROUND) if (it == pending_parcels_.end() || (util::get<0>(it->second) && util::get<0>(it->second)->empty())) #else