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

Infiniband parcelport #2419

Merged
merged 177 commits into from Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
c9ef2ae
Add minimal parcelport plugin interface from Heller
biddisco Mar 6, 2015
cb12a39
Add necessary code to make minimal parcelport example compile
biddisco Mar 6, 2015
4cba3d6
Rename minimal plugin to verbs
biddisco Mar 30, 2015
4ad6c15
Find verbs and rdma_cm scripts
biddisco Mar 6, 2015
a07abc7
First version that allows two nodes to make a connection
biddisco Mar 19, 2015
3b7eb1e
Many CMake changes to handle parcelport compilation
biddisco Mar 19, 2015
56fabf5
First not fully functional version of infiniband verbs interface
biddisco Mar 22, 2015
dbf144b
add simple profiler to network_storage example
biddisco Sep 15, 2014
1cccdee
Fix potentially unnecessary lock
biddisco Mar 1, 2015
d2f6e05
fix MSVC compilation problem
biddisco Feb 24, 2015
7545a74
Debug message and #define cleanup in storage example
biddisco Mar 23, 2015
2ffc65e
Changes to reflect chunk allocation reworking
biddisco Mar 25, 2015
296c2ce
Move message header/tag utilities into location for reuse by any parc…
biddisco Mar 25, 2015
f7395fb
.gitignore for rdmahelper external library
biddisco Mar 25, 2015
62c1637
Create header in-place using registered memory block direct from allo…
biddisco Mar 25, 2015
73f278c
put_parcel + callback + memory region release working for simple sends
biddisco Mar 25, 2015
166ae28
Begin implementation of send of parcels using verbs parcelport
biddisco Mar 26, 2015
f6fa8b9
Add disable_deallocate flag to allocator so that we can take the buff…
biddisco Mar 29, 2015
ff9f7a7
Implement multiple SGE for header/chunks and disable deallocate of me…
biddisco Mar 29, 2015
86f213a
Remove copy from receive buffer into decode_parcels by using a custom…
biddisco Mar 29, 2015
11846ce
Fix serialization related changes after merge with new serialization …
biddisco Apr 4, 2015
ea27900
Wrapper class to takes an rdma buffer and pass it to the parcel decod…
biddisco Apr 11, 2015
866a749
Implement zero-copy chunk get in verbs parcelport using rdma read fro…
biddisco Apr 11, 2015
7fe653e
Initialize remote key to zero in constructor
biddisco Apr 14, 2015
e7c1142
Lots of fixes to handle chunks correctly and pass them into the decod…
biddisco Apr 14, 2015
fd85fe6
Disable reuse of tags to prevent verbs async collisions
biddisco Apr 14, 2015
d874303
Make sure zerocopy chunks are at least as big as default_chunk_size
biddisco Apr 19, 2015
a368ebb
use unsigned int in header
biddisco Apr 21, 2015
552aaeb
Allow one to pass rdma key into serialization chunk create
biddisco Apr 21, 2015
e527bb7
Used memory chunks must be kept until parcel_buffer decode destroys them
biddisco Apr 21, 2015
234debd
Fix boost dyn_link problem with Boost_USE_STATIC_LIBS check
biddisco Apr 21, 2015
b959c14
Implement stop function and close down connection on termination
biddisco Apr 21, 2015
79742ca
Don't release RDMA zero copy buffers back into pool
biddisco Apr 22, 2015
743d235
Undo changes to tag_provider from mpi parcelport as verbs uses atomic…
biddisco Apr 22, 2015
8dc5464
Remove debug log messages from non verbs parcelport code
biddisco Apr 22, 2015
fa04c52
Add locks around maps to improve thread safety.
biddisco Apr 23, 2015
27b7102
Implement move assignment operator
biddisco Apr 24, 2015
af11850
Fix race condition for postSend_xN, add more debug messages
biddisco Apr 24, 2015
7a79000
Fix race : rdma get completing before send has filled get tag map
biddisco Apr 24, 2015
7759311
Tidy up the recv structure handling, use iterator based lookup
biddisco Apr 26, 2015
63e4162
Put a mutex around the active receive list erase call
biddisco Apr 26, 2015
c591325
Clean up HPX_WITH_XXX and HPX_HAVE_XXX for VERBS options after merge …
biddisco May 3, 2015
4f8fa64
Fix problems with faulty declarations of locks and clean up typedefs
biddisco May 5, 2015
061080a
Thread safety for handle_completion in line with changes in RdmaContr…
biddisco May 5, 2015
f208798
Fix CMake Rdmahelper compile_definitions for logging
biddisco May 5, 2015
aa94a12
Move InitiatedConnection flag control into RdmaClient class
biddisco May 15, 2015
95e2436
Only run background_work on an HPX thread and limit number of sends a…
biddisco May 15, 2015
6309e97
Add ignore_while_checking<lock> to guard against a suspend while lock…
biddisco May 15, 2015
4ec39a3
Fix a race if send completion thread suspended during zero copy rdma …
biddisco May 15, 2015
9e4f800
Use atomic counter in rdma get handler for safety
biddisco May 16, 2015
86c9b98
Fix extra background_work when send queue full, can lose a parcel if …
biddisco May 16, 2015
e7819ad
Move simple_profiler into its own header for clarity
biddisco May 18, 2015
62454e3
Add a parcelport handling thread to network storage test
biddisco May 15, 2015
bebdb5f
Use async_cb for management of argument lifetimes
biddisco May 19, 2015
2e817ae
Improve shutdown/stop code to not delete iterator during loop
biddisco May 19, 2015
8509364
User a boolean flag for zero-copy list instead of vector size to prot…
biddisco May 20, 2015
f9d96fd
Fix get of boolean from char array - incorrect Bigendian result from …
biddisco May 21, 2015
ad4bebc
#define syntax cleaned to remove _HAVE_ from non binary defines
biddisco May 21, 2015
3aa4b6b
Fix unsupported Immediate data send on BGAS, move handlers into their…
biddisco May 21, 2015
3bc9174
Fix IBV_WC_SEND not setting the byte_len to the transferred size
biddisco May 22, 2015
5f116bc
Clean up locality definition and remove unused port value
biddisco May 26, 2015
1313848
Make sure header space is large enough for int storage in final slot
biddisco May 26, 2015
334af32
Provide a const iterator access to wrapped pointer vector
biddisco May 26, 2015
78937c9
Fix warning about uninitialized var, remove debug code
biddisco May 26, 2015
3cf0b92
Add a high priority background_work hpx thread for the lifetime of th…
biddisco May 29, 2015
345c19e
Fix race in network storage buffer insert/delete
biddisco Jun 3, 2015
b5f43f0
Enable verbs parcelport in normal testing framework
biddisco Jun 3, 2015
4ee0aef
CMake sets #define for unsupported immediate data if roq network sele…
biddisco Jun 9, 2015
ff5670f
Experimental work on connection race fix
biddisco Jul 15, 2015
5ed92c2
Replace hpx_SOURCE_DIR with PROJECT_SOURCE_DIR
biddisco Aug 10, 2015
abb45d3
Fix broken immediate data for normal (non roq) machines
biddisco Aug 10, 2015
ef9490b
Convert background thread to run on custom scheduler
biddisco Aug 11, 2015
6f195b6
Refill client receives as soon as possible after a receive is popped
biddisco Sep 2, 2015
4eaaecc
Fix issues from merge. Parcels are now move only
biddisco Sep 2, 2015
f35322a
Update parcelport to use new future_await_container to extract/wait f…
biddisco Sep 3, 2015
9e8248f
Fix unsigned comparison compilation error
biddisco Sep 4, 2015
9ef86ea
Clean up names of #defined constants used for chunk management
biddisco Sep 4, 2015
a086973
Make use of custom scheduler conditional (disabled for now)
biddisco Sep 4, 2015
81edbf6
First version of conversion to parcelport_impl usage
biddisco Sep 5, 2015
a4d3d33
Redesign of pinned memory wrapping for send/recv
biddisco Sep 8, 2015
8d9ac25
Clean up some memory allocation usage
biddisco Nov 10, 2015
87ad651
Remove some old unused code and fix a merge issue
biddisco Nov 28, 2015
96350f8
Fix mutex/lock use, safe_bool and shared_ptr after merge with latest hpx
biddisco May 31, 2016
534b32b
Fix boost/std shared ptr compilation problems
biddisco Jun 20, 2016
5e8bfeb
MPI_CXX_LIBRARIES incorrectly used
biddisco Jun 20, 2016
a6add3b
Remove hpx_fwd.hpp
biddisco Jun 20, 2016
c6dda69
Fix hang caused by incorect condition variable check
biddisco Jun 20, 2016
3277d94
Support RDMA get of message region when it does not fit in header
biddisco Jun 20, 2016
9b2728a
Clean up stop (fix hang) of parcelport during shutdown
biddisco Jun 30, 2016
6ad7a4a
Fix a memory leak after CopyFromStorage returns a buffer
biddisco Aug 3, 2016
bd115e2
Improve debug tracking of receive parcel count
biddisco Aug 3, 2016
01bc2f7
No need to delete user/temp regions as the chunk pool now handles it
biddisco Aug 3, 2016
d661542
Fixes to custom scheduler. No boost mutexes etc
biddisco Aug 3, 2016
5ccbaea
Add immediate send trait for parcels with no futures, bypasses parcel…
biddisco Aug 3, 2016
75a51f5
Do not define RDMAHELPER_HAVE_HPX as the rdma helper code will do this
biddisco Aug 3, 2016
a153320
Replace boost chrono with std chrono
biddisco Aug 8, 2016
d3b0931
Add readers_writers_mutex for OS/hpx locking of map
biddisco Aug 31, 2016
6f3fc16
Add concurrent unordered map with readers_writer_lock support
biddisco Aug 31, 2016
fed8491
Enable bootstrapping for verbs parcelport
biddisco Aug 31, 2016
f882168
Do not reset AGAS address if user supplied one
biddisco Aug 31, 2016
d590e41
Disable compiler optimization around atomics and clean up code
biddisco Aug 31, 2016
aa66fe0
Start factoring/moving rdma helper code into new location
biddisco Sep 1, 2016
fe99a41
Cleanup namespaces and typedefs in unordered map
biddisco Sep 1, 2016
83d049c
Redo connection code to handle races between simulateneous connections
biddisco Sep 4, 2016
861993e
Some debug code to see suspended tasks
biddisco Sep 4, 2016
a3153d3
Adding rdma related utilities to remove dependency on rdmahelper library
biddisco Sep 8, 2016
3dec89b
Replace std::map with concurrent::map for send/receive data
biddisco Sep 9, 2016
d4765c4
Add #define to switch between lockfree and normal stack with mutex
biddisco Sep 9, 2016
4019f96
Redesign connection code to improve support for N>2 nodes
biddisco Sep 10, 2016
b4c4646
is_in_map returns a pair<iterator,bool> for better thread safety
biddisco Sep 11, 2016
8c845f3
Start removal of rdmahelper library - Cleanup of parcelport
biddisco Sep 11, 2016
42cf97f
Add a sliding semaphore to limit the number of put/gets generated at …
biddisco Sep 12, 2016
f9726b5
Adding rdma_device from former rdma helper library
biddisco Oct 7, 2016
2fe2a56
Add can_send_immediate to verbs PP
biddisco Oct 30, 2016
ffdbc9d
Remove some obsolete commented out code
biddisco Oct 7, 2016
1bfefd6
Cleanup message header to save a little space
biddisco Oct 11, 2016
e6d885f
Redesign header struct to simplify chunk/message rdma or piggyback se…
biddisco Oct 11, 2016
c57acd4
Add special lock types for debugging
biddisco Oct 25, 2016
7116abc
Add new sender_receiver base class for all connections
biddisco Oct 27, 2016
5e628c6
Rename barrier to rwl_barrier to avoid macro collision
biddisco Oct 27, 2016
30798c6
Use rdma_lock class for improved debugging
biddisco Oct 27, 2016
f5787d6
Fix verbs scheduler to work with latest hpx master
biddisco Oct 27, 2016
c6c4aac
Improve customization of parcel sending for bypassing of connection c…
biddisco Oct 28, 2016
25532dd
Add sliding semaphore option and fix merge/rebase commits
biddisco Oct 28, 2016
def6b23
Use boost::small_vector for some internals to save a malloc
biddisco Oct 28, 2016
d299518
Add throttling of sends by using can_send_immediate to service the pa…
biddisco Oct 28, 2016
1d8a7fb
Fix verbs PP bootstrapping setup (again)
biddisco Nov 8, 2016
0f173bb
Remove obsolete #includes and code. Also fix a debug statement.
biddisco Nov 8, 2016
048d816
Clean up #ifdefs to make things more consistent for options/debug/etc
biddisco Nov 9, 2016
b6e4d08
Remove chunk allocator traits specialization as it is not used
biddisco Nov 12, 2016
aab7404
Set good params for max_preposts and send_queue depth
biddisco Nov 13, 2016
0cdaf33
Cleanup logging to reduce duplicated macros
biddisco Nov 13, 2016
4a888dd
Clean up and refactor all the #define names after adding parcelport_v…
biddisco Nov 17, 2016
ff36cf4
Throttling of sending threads by suspending them if the send queues a…
biddisco Nov 17, 2016
a43cd99
DIRECT actions cannot (yet) return futures, so add an #ifdef to swap …
biddisco Nov 17, 2016
0c6d9c9
Add --no-local option to allow pure network benchmarking (no writes t…
biddisco Nov 19, 2016
7cecab6
Always set correct local IP address to improve console/worker connection
biddisco Aug 17, 2016
d14917f
Fix get_locality_name to return something more sensible/unique
biddisco Nov 24, 2016
3014c43
Only start io threads when bootstrapping with verbs is ON
biddisco Nov 24, 2016
6d372c9
Fix mistake in network_storage BW calculation
biddisco Nov 24, 2016
dbdbceb
Remove sliding semaphore as verbs PP now has throttling capability.
biddisco Nov 24, 2016
8f8183d
Add documentation to explain memory pool usage
biddisco Nov 25, 2016
5f02524
Moving all infiniband related routines into main verbs parcelport dir
biddisco Nov 24, 2016
76e6048
Deadlock fix for event channel connection handling
biddisco Dec 2, 2016
1b4b04e
Fix parcelport registration macro and verbs+boost linking after lib s…
biddisco Dec 3, 2016
f60c1b4
Fix inspect, formatting and naming of variables/files
biddisco Dec 3, 2016
18606a4
Fixing Inspect report errors
biddisco Dec 3, 2016
9370582
Add atomic performance counter (that does nothing when disabled)
biddisco Dec 4, 2016
748dbb2
memory_chunk_pool_allocator is obsolete, remove it and references to it
biddisco Dec 4, 2016
3430846
Clean up some problems only present when full logging enabled
biddisco Dec 4, 2016
ac7fd2a
Replace boost::array with std::array
biddisco Dec 4, 2016
974dfad
Redesign (futurize) connection setup code for verbs parcelport
biddisco Dec 15, 2016
92065e7
Tweak parcelport_connection to remove one unnecessary buffer move in …
biddisco Dec 16, 2016
0d476ad
Do not ack same rdma_cm_event twice
biddisco Dec 16, 2016
b2cb84f
Fix parcelport shutdown by flushing and waiting for receive buffers t…
biddisco Dec 16, 2016
33db41d
Fix shutdown error : Destroy QP before CQ, also set retries back to i…
biddisco Dec 23, 2016
80de7f0
Add a force option to refill preposts so it is not skipped on initial…
biddisco Dec 30, 2016
22cf0ab
Do not process parcels that arrive after hpx::stopped is set
biddisco Dec 30, 2016
fea480d
Handle RDMA_CM_EVENT_TIMEWAIT_EXIT on disconnection correctly
biddisco Dec 30, 2016
6c362d2
Clean up some shutdown checks and some map queries + debug tweaks
biddisco Dec 30, 2016
c195839
Merge remote-tracking branch 'stellar/master' into verbs_rebased
biddisco Dec 30, 2016
08180be
Use Shared Receive Queue and shared Completion Queue
biddisco Jan 3, 2017
bb770d8
Do not check for queued parcels if using 'immediate send' traits/prot…
biddisco Jan 3, 2017
c7f04f3
Fix a race caused by incoming connection completing just as outgoing …
biddisco Jan 3, 2017
d6440ac
Remove request events for completion queue as we do not use them
biddisco Jan 3, 2017
57001c9
Fix retry timout and rnr_retry (7=infinite) counters after recent deb…
biddisco Jan 3, 2017
ea08016
Add warmup to network_storage test and clean up profiler output
biddisco Jan 3, 2017
5498882
Merge remote-tracking branch 'stellar/master' into verbs_rebased
biddisco Jan 4, 2017
83d6f18
Smooth out block cyclic distribution and flag error if 'nolocal' opti…
biddisco Jan 4, 2017
2c10900
Merge branch 'master' into verbs_rebased
Jan 9, 2017
3ce2f1d
Properly setting verbs include directories
Jan 9, 2017
1b85669
Fixing errors reported by clang sanitizers:
Jan 9, 2017
ad0c6c3
Fixing warnings and inspect violations
biddisco Jan 6, 2017
40efbbe
Partially fix a deadlock during connection setup
biddisco Jan 9, 2017
e81c5ac
Revert "Always set correct local IP address to improve console/worker…
biddisco Jan 16, 2017
ec1dbc2
Fix inspect report errors
biddisco Jan 17, 2017
70f6406
Merge branch 'master' into verbs_rebased
biddisco Jan 17, 2017
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: 6 additions & 1 deletion CMakeLists.txt
Expand Up @@ -559,6 +559,9 @@ if(HPX_WITH_PARCEL_PROFILING)
endif()

## Parcelport related build options
hpx_option(HPX_WITH_PARCELPORT_VERBS BOOL
"Enable the ibverbs based parcelport. This is currently an experimental feature"
OFF CATEGORY "Parcelport" ADVANCED)
hpx_option(HPX_WITH_PARCELPORT_MPI BOOL
"Enable the MPI based parcelport."
OFF CATEGORY "Parcelport")
Expand Down Expand Up @@ -1114,7 +1117,9 @@ if(WIN32)
##############################################################################

hpx_add_config_define(BOOST_USE_WINDOWS_H)
hpx_add_config_define(BOOST_SERIALIZATION_DYN_LINK)
if (NOT Boost_USE_STATIC_LIBS)
hpx_add_config_define(BOOST_SERIALIZATION_DYN_LINK)
endif()
if(NOT CMAKE_CL_64)
hpx_add_config_define(BOOST_NO_ALIGNMENT)
endif()
Expand Down
27 changes: 27 additions & 0 deletions cmake/FindIB_VERBS.cmake
@@ -0,0 +1,27 @@
# Copyright (c) 2014 John Biddiscombe
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

# - Try to find IB Verbs
# Once done this will define
# IB_VERBS_FOUND - System has IB Verbs
# IB_VERBS_INCLUDE_DIRS - The IB Verbs include directories
# IB_VERBS_LIBRARIES - The libraries needed to use IB Verbs

find_path(IB_VERBS_INCLUDE_DIR verbs.h
HINTS /usr/local/include /usr/include/infiniband)

find_library(IB_VERBS_LIBRARY NAMES ibverbs
PATHS /usr/local/lib /usr/lib)

set(IB_VERBS_INCLUDE_DIRS ${IB_VERBS_INCLUDE_DIR})
set(IB_VERBS_LIBRARIES ${IB_VERBS_LIBRARY})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set IB_VERBS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(IB_VERBS DEFAULT_MSG
IB_VERBS_INCLUDE_DIR IB_VERBS_LIBRARY)

mark_as_advanced(IB_VERBS_INCLUDE_DIR IB_VERBS_LIBRARY)
27 changes: 27 additions & 0 deletions cmake/FindRDMA_CM.cmake
@@ -0,0 +1,27 @@
# Copyright (c) 2014 John Biddiscombe
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# - Try to find RDMA CM
# Once done this will define
# RDMA_CM_FOUND - System has RDMA CM
# RDMA_CM_INCLUDE_DIRS - The RDMA CM include directories
# RDMA_CM_LIBRARIES - The libraries needed to use RDMA CM

find_path(RDMA_CM_INCLUDE_DIR rdma_cma.h
HINTS /usr/local/include /usr/include/rdma)

find_library(RDMA_CM_LIBRARY NAMES rdmacm
PATHS /usr/local/lib /usr/lib)

set(RDMA_CM_INCLUDE_DIRS ${RDMA_CM_INCLUDE_DIR})
set(RDMA_CM_LIBRARIES ${RDMA_CM_LIBRARY})

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set RDMA_CM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(RDMA_CM DEFAULT_MSG
RDMA_CM_INCLUDE_DIR RDMA_CM_LIBRARY)

mark_as_advanced(RDMA_CM_INCLUDE_DIR RDMA_CM_LIBRARY)
8 changes: 4 additions & 4 deletions cmake/HPX_AddTest.cmake
Expand Up @@ -52,11 +52,11 @@ macro(add_hpx_test category name)
NAME "${category}.${name}"
COMMAND ${cmd} ${args})
else()
if(HPX_WITH_PARCELPORT_IBVERBS)
if(HPX_WITH_PARCELPORT_VERBS)
set(_add_test FALSE)
if(DEFINED ${name}_PARCELPORTS)
set(PP_FOUND -1)
list(FIND ${name}_PARCELPORTS "ibverbs" PP_FOUND)
list(FIND ${name}_PARCELPORTS "verbs" PP_FOUND)
if(NOT PP_FOUND EQUAL -1)
set(_add_test TRUE)
endif()
Expand All @@ -65,8 +65,8 @@ macro(add_hpx_test category name)
endif()
if(_add_test)
add_test(
NAME "${category}.distributed.ibverbs.${name}"
COMMAND ${cmd} "-p" "ibverbs" ${args})
NAME "${category}.distributed.verbs.${name}"
COMMAND ${cmd} "-p" "verbs" ${args})
endif()
endif()
if(HPX_WITH_PARCELPORT_IPC)
Expand Down
6 changes: 6 additions & 0 deletions cmake/HPX_SetupBoost.cmake
Expand Up @@ -21,6 +21,11 @@ set(Boost_ADDITIONAL_VERSIONS
"1.58.0" "1.58"
"1.57.0" "1.57")

set(HPX_BOOST_LOG_LIBS "")
if(HPX_PARCELPORT_VERBS_WITH_LOGGING OR HPX_PARCELPORT_VERBS_WITH_DEV_MODE)
set(HPX_BOOST_LOG_LIBS log log_setup)
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to use two different logging libraries in HPX? The one we currently use might not be the best of all choices, but having two at the same time isn't a compelling option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The majority of the rdma code was originally in its own mini library and was using boost log. The logging code is only activated when enabled via cmake options and I would not expect anyone other than myself or another developer interested in the verbs parcelport to activate it.
I agree that we should have just one logging options, but this has proven to be my #1 mean of diagnosing problems and leaving it in for the time being is not going to cost anyone. In the long term we should migrate to a single logging infrastructure - but I'd like to postpone this until this is proven to be production stable.


find_package(Boost
1.50
REQUIRED
Expand All @@ -32,6 +37,7 @@ find_package(Boost
regex
system
thread
${HPX_BOOST_LOG_LIBS}
)

if(NOT Boost_FOUND)
Expand Down
6 changes: 3 additions & 3 deletions cmake/templates/hpxrun.py.in
Expand Up @@ -99,7 +99,7 @@ def build_cmd(options, args):
if options.localities > 1:
# Selecting the parcelport for hpx via hpx ini confifuration
select_parcelport = (lambda pp:
['-Ihpx.parcel.ibverbs.enable=1'] if pp == 'ibverbs'
['-Ihpx.parcel.verbs.enable=1'] if pp == 'verbs'
else ['-Ihpx.parcel.ipc.enable=1'] if pp == 'ipc'
else ['-Ihpx.parcel.mpi.enable=1', '-Ihpx.parcel.bootstrap=mpi'] if pp == 'mpi'
else ['-Ihpx.parcel.tcp.enable=1'] if pp == 'tcp'
Expand Down Expand Up @@ -140,7 +140,7 @@ def check_options(parser, options, args):
sys.exit(1)

check_valid_parcelport = (lambda x:
x == 'ibverbs' or x == 'ipc' or x == 'mpi' or x == 'tcp');
x == 'verbs' or x == 'ipc' or x == 'mpi' or x == 'tcp');
if not check_valid_parcelport(options.parcelport):
print('Error: Parcelport option not valid\n', sys.stderr)
parser.print_help()
Expand Down Expand Up @@ -203,7 +203,7 @@ if __name__ == '__main__':
parser.add_option('-p', '--parcelport'
, action='store', type='string'
, dest='parcelport', default=default_env('HPXRUN_PARCELPORT', 'tcp')
, help='Which parcelport to use (Options are: ibverbs, ipc, mpi, tcp) '
, help='Which parcelport to use (Options are: verbs, ipc, mpi, tcp) '
'(environment variable HPXRUN_PARCELPORT')

parser.add_option('-r', '--runwrapper'
Expand Down
17 changes: 14 additions & 3 deletions hpx/runtime/parcelset/parcel_buffer.hpp
Expand Up @@ -32,21 +32,28 @@ namespace hpx { namespace parcelset
explicit parcel_buffer(allocator_type allocator = allocator_type())
: data_(allocator)
, num_chunks_(count_chunks_type(0, 0))
, size_(0), data_size_(0)
, size_(0), data_size_(0), header_size_(0)
{}

explicit parcel_buffer(BufferType const & data,
allocator_type allocator = allocator_type())
: data_(data, allocator)
, num_chunks_(count_chunks_type(0, 0))
, size_(0), data_size_(0)
, size_(0), data_size_(0), header_size_(0)
{}

explicit parcel_buffer(BufferType && data,
allocator_type allocator = allocator_type())
: data_(std::move(data), allocator)
, num_chunks_(count_chunks_type(0, 0))
, size_(0), data_size_(0)
, size_(0), data_size_(0), header_size_(0)
{}

explicit parcel_buffer(BufferType && data,
allocator_type *allocator)
: data_(std::move(data))
, num_chunks_(count_chunks_type(0, 0))
, size_(0), data_size_(0), header_size_(0)
{}

parcel_buffer(parcel_buffer && other)
Expand All @@ -56,6 +63,7 @@ namespace hpx { namespace parcelset
, num_chunks_(other.num_chunks_)
, size_(other.size_)
, data_size_(other.data_size_)
, header_size_(other.header_size_)
, data_point_(other.data_point_)
{
}
Expand All @@ -68,6 +76,7 @@ namespace hpx { namespace parcelset
num_chunks_ = other.num_chunks_;
size_ = other.size_;
data_size_ = other.data_size_;
header_size_ = other.header_size_;
data_point_ = other.data_point_;

return *this;
Expand All @@ -81,6 +90,7 @@ namespace hpx { namespace parcelset
num_chunks_ = count_chunks_type(0, 0);
size_ = 0;
data_size_ = 0;
header_size_ = 0;
data_point_ = performance_counters::parcels::data_point();
}

Expand All @@ -97,6 +107,7 @@ namespace hpx { namespace parcelset

util::integer::ulittle64_t size_;
util::integer::ulittle64_t data_size_;
util::integer::ulittle64_t header_size_;

/// Counters and their data containers.
performance_counters::parcels::data_point data_point_;
Expand Down
18 changes: 14 additions & 4 deletions hpx/runtime/parcelset/parcelport_connection.hpp
Expand Up @@ -11,6 +11,7 @@

#include <cstdint>
#include <memory>
#include <utility>

namespace hpx { namespace parcelset {

Expand All @@ -25,6 +26,10 @@ namespace hpx { namespace parcelset {
struct parcelport_connection
: std::enable_shared_from_this<Connection>
{
////////////////////////////////////////////////////////////////////////
typedef BufferType buffer_type;
typedef parcel_buffer<buffer_type, ChunkType> parcel_buffer_type;

private:
HPX_NON_COPYABLE(parcelport_connection);

Expand Down Expand Up @@ -92,6 +97,15 @@ namespace hpx { namespace parcelset {
parcelport_connection(typename BufferType::allocator_type const & alloc)
: buffer_(alloc)
{}

parcelport_connection(typename BufferType::allocator_type * alloc)
: buffer_(std::move(buffer_type(alloc)),alloc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ctor really necessary? the move shouldn't be necessary here. buffer_type(alloc) should already return an rvalue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check this and fix it.

{}

parcelport_connection(parcel_buffer_type && buffer)
: buffer_(std::move(buffer))
{}

#endif

#if defined(HPX_TRACK_STATE_OF_OUTGOING_TCP_CONNECTION)
Expand All @@ -103,10 +117,6 @@ namespace hpx { namespace parcelset {

virtual ~parcelport_connection() {}

////////////////////////////////////////////////////////////////////////
typedef BufferType buffer_type;
typedef parcel_buffer<buffer_type, ChunkType> parcel_buffer_type;

/// buffer for data
parcel_buffer_type buffer_;
};
Expand Down
6 changes: 5 additions & 1 deletion hpx/runtime/parcelset/parcelport_impl.hpp
Expand Up @@ -339,7 +339,11 @@ namespace hpx { namespace parcelset

bool do_background_work(std::size_t num_thread)
{
trigger_pending_work();
if (!connection_handler_traits<ConnectionHandler>::
send_immediate_parcels::value)
{
trigger_pending_work();
}
return do_background_work_impl<ConnectionHandler>(num_thread);
}

Expand Down
15 changes: 8 additions & 7 deletions hpx/runtime/serialization/serialization_chunk.hpp
Expand Up @@ -40,26 +40,27 @@ namespace hpx { namespace serialization

struct serialization_chunk
{
chunk_data data_; // index or pointer
std::size_t size_;
// size of the serialization_chunk starting at index_/pos_
std::uint8_t type_; // chunk_type
chunk_data data_; // index or pointer
std::size_t size_; // size of the serialization_chunk starting index_/pos_
std::uint8_t type_; // chunk_type
std::uint32_t rkey_; // optional RDMA remote key for parcelport put/get operations
};

///////////////////////////////////////////////////////////////////////
inline serialization_chunk create_index_chunk(std::size_t index, std::size_t size)
{
serialization_chunk retval = {
{ 0 }, size, static_cast<std::uint8_t>(chunk_type_index)
{ 0 }, size, static_cast<std::uint8_t>(chunk_type_index), 0
};
retval.data_.index_ = index;
return retval;
}

inline serialization_chunk create_pointer_chunk(void const* pos, std::size_t size)
inline serialization_chunk create_pointer_chunk(void const* pos, std::size_t size,
std::uint32_t rkey=0)
{
serialization_chunk retval = {
{ 0 }, size, static_cast<std::uint8_t>(chunk_type_pointer)
{ 0 }, size, static_cast<std::uint8_t>(chunk_type_pointer), rkey
};
retval.data_.cpos_ = pos;
return retval;
Expand Down