-
-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve(lci pp): more options to control the behavior of the LCI parc…
…elport - split the comp_type option into comp_type_header and comp_type_followup - add new progress_type option: poll - add enable_sendmc option - add bg_work_max_count, bg_work_when_send for more control of background work invocation - improve completion_manager_sync to better simulate MPI
- Loading branch information
Showing
19 changed files
with
421 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...i/include/hpx/parcelport_lci/completion_manager/completion_manager_sync_single_nolock.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2014-2023 Thomas Heller | ||
// | ||
// SPDX-License-Identifier: BSL-1.0 | ||
// 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) | ||
|
||
#pragma once | ||
|
||
#include <hpx/config.hpp> | ||
|
||
#if defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI) | ||
|
||
#include <hpx/parcelport_lci/completion_manager_base.hpp> | ||
|
||
namespace hpx::parcelset::policies::lci { | ||
struct completion_manager_sync_single_nolock | ||
: public completion_manager_base | ||
{ | ||
completion_manager_sync_single_nolock(parcelport* pp) | ||
: completion_manager_base(pp) | ||
{ | ||
LCI_sync_create(LCI_UR_DEVICE, 1, &sync); | ||
} | ||
|
||
~completion_manager_sync_single_nolock() | ||
{ | ||
LCI_sync_free(&sync); | ||
} | ||
|
||
LCI_comp_t alloc_completion() | ||
{ | ||
return sync; | ||
} | ||
|
||
void enqueue_completion(LCI_comp_t comp) | ||
{ | ||
HPX_UNUSED(comp); | ||
} | ||
|
||
LCI_request_t poll(); | ||
|
||
private: | ||
LCI_comp_t sync; | ||
}; | ||
} // namespace hpx::parcelset::policies::lci | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
libs/full/parcelport_lci/src/completion_manager/completion_manager_queue.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <hpx/parcelport_lci/completion_manager/completion_manager_queue.hpp> | ||
#include <hpx/parcelport_lci/parcelport_lci.hpp> | ||
|
||
namespace hpx::parcelset::policies::lci { | ||
LCI_request_t completion_manager_queue::poll() | ||
{ | ||
LCI_request_t request; | ||
request.flag = LCI_ERR_RETRY; | ||
LCI_queue_pop(queue, &request); | ||
if (request.flag == LCI_ERR_RETRY) | ||
if (config_t::progress_type == config_t::progress_type_t::poll) | ||
pp_->do_progress_local(); | ||
return request; | ||
} | ||
} // namespace hpx::parcelset::policies::lci |
37 changes: 37 additions & 0 deletions
37
libs/full/parcelport_lci/src/completion_manager/completion_manager_sync.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <hpx/parcelport_lci/completion_manager/completion_manager_sync.hpp> | ||
#include <hpx/parcelport_lci/parcelport_lci.hpp> | ||
|
||
namespace hpx::parcelset::policies::lci { | ||
LCI_request_t completion_manager_sync::poll() | ||
{ | ||
LCI_request_t request; | ||
request.flag = LCI_ERR_RETRY; | ||
|
||
LCI_comp_t sync = nullptr; | ||
{ | ||
std::unique_lock l(lock, std::try_to_lock); | ||
if (l.owns_lock() && !sync_list.empty()) | ||
{ | ||
sync = sync_list.front(); | ||
sync_list.pop_front(); | ||
} | ||
} | ||
if (sync) | ||
{ | ||
LCI_error_t ret = LCI_sync_test(sync, &request); | ||
if (ret == LCI_OK) | ||
{ | ||
HPX_ASSERT(request.flag == LCI_OK); | ||
LCI_sync_free(&sync); | ||
} | ||
else | ||
{ | ||
if (config_t::progress_type == config_t::progress_type_t::poll) | ||
pp_->do_progress_local(); | ||
std::unique_lock l(lock); | ||
sync_list.push_back(sync); | ||
} | ||
} | ||
return request; | ||
} | ||
} // namespace hpx::parcelset::policies::lci |
23 changes: 23 additions & 0 deletions
23
libs/full/parcelport_lci/src/completion_manager/completion_manager_sync_single.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <hpx/parcelport_lci/completion_manager/completion_manager_sync_single.hpp> | ||
#include <hpx/parcelport_lci/parcelport_lci.hpp> | ||
|
||
namespace hpx::parcelset::policies::lci { | ||
LCI_request_t completion_manager_sync_single::poll() | ||
{ | ||
LCI_request_t request; | ||
request.flag = LCI_ERR_RETRY; | ||
|
||
bool succeed = lock.try_lock(); | ||
if (succeed) | ||
{ | ||
LCI_error_t ret = LCI_sync_test(sync, &request); | ||
if (ret == LCI_ERR_RETRY) | ||
{ | ||
if (config_t::progress_type == config_t::progress_type_t::poll) | ||
pp_->do_progress_local(); | ||
lock.unlock(); | ||
} | ||
} | ||
return request; | ||
} | ||
} // namespace hpx::parcelset::policies::lci |
16 changes: 16 additions & 0 deletions
16
libs/full/parcelport_lci/src/completion_manager/completion_manager_sync_single_nolock.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <hpx/parcelport_lci/completion_manager/completion_manager_sync_single_nolock.hpp> | ||
#include <hpx/parcelport_lci/parcelport_lci.hpp> | ||
|
||
namespace hpx::parcelset::policies::lci { | ||
LCI_request_t completion_manager_sync_single_nolock::poll() | ||
{ | ||
LCI_request_t request; | ||
request.flag = LCI_ERR_RETRY; | ||
|
||
LCI_sync_test(sync, &request); | ||
if (request.flag == LCI_ERR_RETRY) | ||
if (config_t::progress_type == config_t::progress_type_t::poll) | ||
pp_->do_progress_local(); | ||
return request; | ||
} | ||
} // namespace hpx::parcelset::policies::lci |
Oops, something went wrong.