Skip to content

Commit

Permalink
Removing hpx::lcos::queue<T>
Browse files Browse the repository at this point in the history
- this fixes #2641
  • Loading branch information
hkaiser committed May 29, 2017
1 parent 4062ca2 commit 9cfae78
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -847,6 +847,14 @@ if(HPX_WITH_ASYNC_FUNCTION_COMPATIBILITY)
hpx_add_config_define(HPX_HAVE_ASYNC_FUNCTION_COMPATIBILITY)
endif()

# HPX_WITH_QUEUE_COMPATIBILITY: introduced in V1.1.0
hpx_option(HPX_WITH_QUEUE_COMPATIBILITY BOOL
"Enable old style queue components in API (default: OFF)"
OFF ADVANCED)
if(HPX_WITH_QUEUE_COMPATIBILITY)
hpx_add_config_define(HPX_HAVE_QUEUE_COMPATIBILITY)
endif()

# BADBAD: This enables an overload of swap which is necessary to work around the
# problems caused by zip_iterator not being a real random access iterator.
# Dereferencing zip_iterator does not yield a true reference but
Expand Down
7 changes: 5 additions & 2 deletions docs/whats_new.qbk
Expand Up @@ -24,17 +24,20 @@ particular order):
* The parameter sequence for the `hpx::parallel::transform_inclusive_scan` overload
taking one iterator range has changed (again) to match the changes this algorithm
has undergone while being moved to C++17. The old overloads can be still enabled
at configure time by specifying `-DHPX_WITH_TRANSFORM_REDUCE_COMPATIBILITY=On`
at configure time by passing `-DHPX_WITH_TRANSFORM_REDUCE_COMPATIBILITY=On`
to __cmake__.
* The parameter sequence for the `hpx::parallel::inclusive_scan` overload
taking one iterator range has changed to match the changes this algorithm
has undergone while being moved to C++17. The old overloads can be still enabled
at configure time by specifying `-DHPX_WITH_INCLUSIVE_SCAN_COMPATIBILITY=On`
at configure time by passing `-DHPX_WITH_INCLUSIVE_SCAN_COMPATIBILITY=On`
to __cmake__.
* Added a helper facility `hpx::local_new` which is equivalent to `hpx::new_`
except that it creates components locally only. As a consequence, the used
component constructor may accept non-serializable argument types and/or
non-const references or pointers.
* Removed the (broken) component type `hpx::lcos::queue<T>`. The old type is
still available at configure time by passing
`-DHPX_WITH_QUEUE_COMPATIBILITY=On` to __cmake__.

[heading Breaking Changes]

Expand Down
7 changes: 6 additions & 1 deletion examples/CMakeLists.txt
Expand Up @@ -20,7 +20,6 @@ set(subdirs
jacobi_smp
nqueen
performance_counters
queue
quickstart
qt
random_mem_access
Expand All @@ -32,6 +31,12 @@ set(subdirs
transpose
)

if(HPX_WITH_QUEUE_COMPATIBILITY)
set(subdirs ${subdirs}
queue
)
endif()

if(HPX_WITH_FORTRAN)
set(subdirs ${subdirs}
sheneos
Expand Down
8 changes: 6 additions & 2 deletions examples/queue/queue_client.cpp
Expand Up @@ -6,6 +6,7 @@
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>

#if defined(HPX_HAVE_QUEUE_COMPATIBILITY)
#include <hpx/include/lcos.hpp>

#include <iostream>
Expand All @@ -32,10 +33,12 @@ void break_queue(queue_type queue)
{
queue.abort_pending();
}
#endif

///////////////////////////////////////////////////////////////////////////////
int hpx_main(boost::program_options::variables_map &vm)
{
#if defined(HPX_HAVE_QUEUE_COMPATIBILITY)
// Create a new queue of integers.
queue_type queue = hpx::new_<queue_type>(hpx::find_here());

Expand All @@ -53,13 +56,14 @@ int hpx_main(boost::program_options::variables_map &vm)
hpx::apply(hpx::util::bind(&worker, queue));

hpx::apply(hpx::util::bind(&break_queue, queue));
#endif

hpx::finalize();
return 0;
return hpx::finalize();
}

///////////////////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
return hpx::init("queue_of_ints_client", argc, argv);
}

4 changes: 3 additions & 1 deletion hpx/include/lcos.hpp
@@ -1,4 +1,4 @@
// Copyright (c) 2007-2015 Hartmut Kaiser
// Copyright (c) 2007-2017 Hartmut Kaiser
// Copyright (c) 2011 Bryce Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand All @@ -19,7 +19,9 @@
#include <hpx/lcos/channel.hpp>
#include <hpx/lcos/gather.hpp>
#include <hpx/lcos/latch.hpp>
#if defined(HPX_HAVE_QUEUE_COMPATIBILITY)
#include <hpx/lcos/queue.hpp>
#endif
#include <hpx/lcos/reduce.hpp>

#include <hpx/include/async.hpp>
Expand Down
3 changes: 3 additions & 0 deletions hpx/lcos/queue.hpp
Expand Up @@ -7,6 +7,8 @@
#define HPX_LCOS_QUEUE_FEB_10_2011_1232PM

#include <hpx/config.hpp>

#if defined(HPX_HAVE_QUEUE_COMPATIBILITY)
#include <hpx/lcos/server/queue.hpp>
#include <hpx/runtime/components/client_base.hpp>

Expand Down Expand Up @@ -134,4 +136,5 @@ namespace hpx { namespace lcos
}}

#endif
#endif

3 changes: 3 additions & 0 deletions hpx/lcos/server/queue.hpp
Expand Up @@ -7,6 +7,8 @@
#define HPX_LCOS_SERVER_QUEUE_FEB_09_2011_1204PM

#include <hpx/config.hpp>

#if defined(HPX_HAVE_QUEUE_COMPATIBILITY)
#include <hpx/error_code.hpp>
#include <hpx/exception_fwd.hpp>
#include <hpx/lcos/base_lco_with_value.hpp>
Expand Down Expand Up @@ -197,4 +199,5 @@ namespace hpx { namespace lcos { namespace server
/**/

#endif
#endif

0 comments on commit 9cfae78

Please sign in to comment.