Skip to content

Commit

Permalink
#1111: backport: fix argument handling
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Dec 21, 2020
1 parent 6c04ed2 commit 3d70940
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/vt/configs/arguments/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,10 @@ static std::unique_ptr<char*[]> new_argv = nullptr;
/*
* Options for configuring the runtime
*/
auto max_size = "Maximum MPI send size (causes larger messages to be split "
"into multiple MPI sends)";
auto a1x = app.add_option(
"--vt_max_mpi_send_size", config_.vt_max_mpi_send_size, max_size, true
"--vt_max_mpi_send_size", vt_max_mpi_send_size, max_size, true
);

auto configRuntime = "Runtime";
Expand Down
2 changes: 1 addition & 1 deletion src/vt/configs/arguments/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct ArgConfig {
static bool vt_debug_objgroup;

static bool vt_debug_print_flush;
std::size_t vt_max_mpi_send_size;
static std::size_t vt_max_mpi_send_size;

static bool vt_user_1;
static bool vt_user_2;
Expand Down
14 changes: 7 additions & 7 deletions src/vt/messaging/active.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void ActiveMessenger::handleChunkedMultiMsg(MultiMsg* msg) {
auto const tag = info.getTag();

auto fn = [buf,sender,size,tag,this](PtrLenPairType,ActionType){
vt_debug_print(
debug_print(
active, node,
"handleChunkedMultiMsg: all chunks arrived tag={}, size={}, from={}\n",
tag, size, sender
Expand All @@ -234,13 +234,13 @@ EventType ActiveMessenger::sendMsgMPI(

char* untyped_msg = reinterpret_cast<char*>(base_typed_msg);

vt_debug_print(
debug_print(
active, node,
"sendMsgMPI: dest={}, msg_size={}, send_tag={}\n",
dest, msg_size, send_tag
);

auto const max_per_send = theConfig()->vt_max_mpi_send_size;
auto const max_per_send = ArgType::vt_max_mpi_send_size;
if (static_cast<std::size_t>(msg_size) < max_per_send) {
auto const event_id = theEvent()->createMPIEvent(this_node_);
auto& holder = theEvent()->getEventHolder(event_id);
Expand Down Expand Up @@ -274,7 +274,7 @@ EventType ActiveMessenger::sendMsgMPI(

return event_id;
} else {
vt_debug_print(
debug_print(
active, node,
"sendMsgMPI: (multi): size={}\n", msg_size
);
Expand Down Expand Up @@ -471,7 +471,7 @@ std::tuple<EventType, int> ActiveMessenger::sendDataMPI(
int num_sends = 0;
std::vector<EventType> events;
EventType ret_event = no_event;
auto const max_per_send = theConfig()->vt_max_mpi_send_size;
auto const max_per_send = ArgType::vt_max_mpi_send_size;
while (remainder > 0) {
auto const event_id = theEvent()->createMPIEvent(this_node_);
auto& holder = theEvent()->getEventHolder(event_id);
Expand All @@ -487,7 +487,7 @@ std::tuple<EventType, int> ActiveMessenger::sendDataMPI(
}
#endif

vt_debug_print(
debug_print(
active, node,
"sendDataMPI: remainder={}, node={}, tag={}, num_sends={}, subsize={},"
"total size={}\n",
Expand Down Expand Up @@ -672,7 +672,7 @@ void ActiveMessenger::recvDataDirect(

char* cbuf = static_cast<char*>(buf);
MsgSizeType remainder = len;
auto const max_per_send = theConfig()->vt_max_mpi_send_size;
auto const max_per_send = ArgType::vt_max_mpi_send_size;
for (int i = 0; i < nchunks; i++) {
auto sublen = static_cast<int>(
std::min(static_cast<std::size_t>(remainder), max_per_send)
Expand Down

0 comments on commit 3d70940

Please sign in to comment.