Skip to content

Commit

Permalink
#306: remove shadow warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nlslatt committed Mar 26, 2019
1 parent fe56ece commit 943409a
Show file tree
Hide file tree
Showing 26 changed files with 102 additions and 102 deletions.
4 changes: 2 additions & 2 deletions examples/collection_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ void ColA::work(TestMsg* msg) {

if (getIndex().x() == 2) {
auto const& proxy = getCollectionProxy();
auto const& msg = makeSharedMessage<TestMsg>();
proxy.broadcast<TestMsg,&ColA::work2>(msg);
auto const& msg2 = makeSharedMessage<TestMsg>();
proxy.broadcast<TestMsg,&ColA::work2>(msg2);
}

auto reduce_msg = makeSharedMessage<MyReduceMsg>(getIndex().x());
Expand Down
6 changes: 3 additions & 3 deletions examples/group_example_1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ int main(int argc, char** argv) {
);
this_group = theGroup()->newGroup(std::move(list), [](GroupType group){
fmt::print("Group is created\n");
auto msg = makeSharedMessage<HelloGroupMsg>();
envelopeSetGroup(msg->env, group);
theMsg()->broadcastMsg<HelloGroupMsg, hello_group_handler>(msg);
auto gmsg = makeSharedMessage<HelloGroupMsg>();
envelopeSetGroup(gmsg->env, group);
theMsg()->broadcastMsg<HelloGroupMsg, hello_group_handler>(gmsg);
});
}

Expand Down
4 changes: 2 additions & 2 deletions examples/jacobi1d_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ static void startJacobi1dHandler(StartWorkMsg* msg) {
theMsg()->broadcastMsg<JacobiKernelMsg, doKernel>(
makeSharedMessage<JacobiKernelMsg>(cur_iter)
);
JacobiKernelMsg msg(cur_iter);
doKernel(&msg);
JacobiKernelMsg kmsg(cur_iter);
doKernel(&kmsg);
}
} else {
finished();
Expand Down
6 changes: 3 additions & 3 deletions examples/rdma_simple_put.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ static void put_data_fn(TestMsg* msg) {
[=]{
delete [] local_data;
fmt::print("{}: after put: sending msg back to 0\n", my_node);
auto msg = makeSharedMessage<TestMsg>(my_node);
msg->han = my_handle;
theMsg()->sendMsg<TestMsg,read_data_fn>(0, msg);
auto msg2 = makeSharedMessage<TestMsg>(my_node);
msg2->han = my_handle;
theMsg()->sendMsg<TestMsg,read_data_fn>(0, msg2);
}
);
}
Expand Down
6 changes: 3 additions & 3 deletions examples/term_ds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ static void test_handler(TestMsg* msg) {
num--;

if (num > 0) {
auto msg = makeSharedMessage<TestMsg>();
envelopeSetEpoch(msg->env, cur_epoch);
theMsg()->sendMsg<TestMsg,test_handler>((my_node + 1) % num_nodes,msg);
auto msg2 = makeSharedMessage<TestMsg>();
envelopeSetEpoch(msg2->env, cur_epoch);
theMsg()->sendMsg<TestMsg,test_handler>((my_node + 1) % num_nodes,msg2);
}
}

Expand Down
20 changes: 10 additions & 10 deletions examples/test_seq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ static void mySeq(SeqType const& seq_id) {

theSeq()->sequenced([]{
PRINT_SEQUENCE("action1 sequenced_block triggered\n");
auto const& my_node = theContext()->getNode();
auto const& this_node = theContext()->getNode();
theMsg()->sendMsg<EmptyMsg, action1>(
my_node, makeSharedMessage<EmptyMsg>(), 20
this_node, makeSharedMessage<EmptyMsg>(), 20
);
});

Expand Down Expand Up @@ -192,9 +192,9 @@ static void simpleSeq(SeqType const& seq_id) {
PRINT_SEQUENCE("simpleSeq: executing sequence: seq_id={}\n", seq_id);

theSeq()->wait<EmptyMsg, action1>(10, [](EmptyMsg* msg){
auto const& seq_id = theSeq()->getCurrentSeq();
auto const& cur_seq_id = theSeq()->getCurrentSeq();
PRINT_SEQUENCE(
"simpleSeq: seq={}: w1 triggered: msg={}\n", seq_id, print_ptr(msg)
"simpleSeq: seq={}: w1 triggered: msg={}\n", cur_seq_id, print_ptr(msg)
);
});

Expand All @@ -210,16 +210,16 @@ static void simpleSeq(SeqType const& seq_id) {
});

theSeq()->wait<EmptyMsg, action1>(20, [](EmptyMsg* msg){
auto const& seq_id = theSeq()->getCurrentSeq();
auto const& cur_seq_id = theSeq()->getCurrentSeq();
PRINT_SEQUENCE(
"simpleSeq: seq={}: w2 triggered: msg={}\n", seq_id, print_ptr(msg)
"simpleSeq: seq={}: w2 triggered: msg={}\n", cur_seq_id, print_ptr(msg)
);
theMsg()->sendMsg<EmptyMsg, action1>(0, makeSharedMessage<EmptyMsg>(), 30);
});

theSeq()->wait<EmptyMsg, action1>(30, [](EmptyMsg* msg){
auto const& seq_id = theSeq()->getCurrentSeq();
PRINT_SEQUENCE("simpleSeq: seq={}: w3 triggered\n", seq_id);
auto const& cur_seq_id = theSeq()->getCurrentSeq();
PRINT_SEQUENCE("simpleSeq: seq={}: w3 triggered\n", cur_seq_id);
});

theSeq()->sequenced([]{
Expand Down Expand Up @@ -247,8 +247,8 @@ static void simpleSeq(SeqType const& seq_id) {
});

theSeq()->wait<EmptyMsg, action1>(40, [](EmptyMsg* msg){
auto const& seq_id = theSeq()->getCurrentSeq();
PRINT_SEQUENCE("simpleSeq: seq={}: w4 triggered\n", seq_id);
auto const& cur_seq_id = theSeq()->getCurrentSeq();
PRINT_SEQUENCE("simpleSeq: seq={}: w4 triggered\n", cur_seq_id);
});
}

Expand Down
8 changes: 4 additions & 4 deletions examples/transpose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ struct SubSolveInfo {
struct Block : Collection<Block,Index1D> {

Block() = default;
Block(int num_elm, int num_pieces) {
Block(int num_elm, int n_pieces) {
::fmt::print(
"construct: node={}, elm={}, pieces={}\n",
theContext()->getNode(), num_elm, num_pieces
theContext()->getNode(), num_elm, n_pieces
);
}

Expand Down Expand Up @@ -230,11 +230,11 @@ ::vt::NodeType my_map(IndexT* idx, IndexT* max_idx, NodeType num_nodes) {
solver_info.have_blocks_++;
} else {
// It's a remote collection block
auto msg = makeSharedMessage<RequestDataMsg<Block>>(this_node);
auto msg2 = makeSharedMessage<RequestDataMsg<Block>>(this_node);
// Here we will send "this_node" to indicate which nod it should come back
// to. Eventually, I will implement a "sub_rank" in VT which can use the
// sub-rank instead of the global node id.
proxy[block_id].send<RequestDataMsg<Block>,&Block::dataRequest>(msg);
proxy[block_id].send<RequestDataMsg<Block>,&Block::dataRequest>(msg2);
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/vt/collective/collective_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ void CollectiveAnyOps<instance>::abort(
std::string const str, ErrorCodeType const code
) {
auto tls_rt = curRT;
auto rt = tls_rt ? tls_rt : ::vt::rt;
if (rt) {
rt->abort(str, code);
auto myrt = tls_rt ? tls_rt : ::vt::rt;
if (myrt) {
myrt->abort(str, code);
} else {
std::exit(code);
}
Expand All @@ -155,9 +155,9 @@ void CollectiveAnyOps<instance>::output(
bool formatted, bool abort_out
) {
auto tls_rt = curRT;
auto rt = tls_rt ? tls_rt : ::vt::rt;
if (rt) {
rt->output(str,code,error,decorate,formatted);
auto myrt = tls_rt ? tls_rt : ::vt::rt;
if (myrt) {
myrt->output(str,code,error,decorate,formatted);
} else {
::fmt::print(str.c_str());
}
Expand Down
10 changes: 5 additions & 5 deletions src/vt/configs/arguments/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ namespace vt { namespace arguments {

// Reverse iterate (CLI11 reverses the order when they modify the args)
for (auto iter = args.rbegin(); iter != args.rend(); ++iter) {
for (auto i = 0; i < argc; i++) {
if (std::string(argv[i]) == *iter) {
ret_idx.push_back(i);
for (auto ii = 0; ii < argc; ii++) {
if (std::string(argv[ii]) == *iter) {
ret_idx.push_back(ii);
}
}
ret_args.push_back(*iter);
Expand All @@ -449,8 +449,8 @@ namespace vt { namespace arguments {
// Use the saved index to setup the new_argv and new_argc
int new_argc = ret_args.size();
char** new_argv = new char*[new_argc];
for (auto i = 0; i < new_argc; i++) {
new_argv[i] = argv[ret_idx[i]];
for (auto ii = 0; ii < new_argc; ii++) {
new_argv[ii] = argv[ret_idx[ii]];
}

// Set them back with all vt arguments elided
Expand Down
14 changes: 7 additions & 7 deletions src/vt/event/event_record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ bool EventRecord::testMPIEventReady() {

MPI_Test(req, &flag, &stat);

bool const ready = flag == 1;
bool const mpiready = flag == 1;

if (ready and msg_ != nullptr and isSharedMessage(msg_.get())) {
if (mpiready and msg_ != nullptr and isSharedMessage(msg_.get())) {
debug_print(
verbose, active, node,
"testMPIEventRead: deref: msg={}\n",
Expand All @@ -96,24 +96,24 @@ bool EventRecord::testMPIEventReady() {
msg_ = nullptr;
}

return ready;
return mpiready;
}

bool EventRecord::testNormalEventReady() {
return false;
}

bool EventRecord::testParentEventReady() {
bool ready = true;
bool parent_ready = true;
auto events = getEventList();
for (auto&& e : *events) {
ready &=
parent_ready &=
theEvent()->testEventComplete(e) == AsyncEvent::EventStateType::EventReady;
}
if (ready) {
if (parent_ready) {
events->clear();
}
return ready;
return parent_ready;
}

EventType EventRecord::getEventID() const {
Expand Down
8 changes: 4 additions & 4 deletions src/vt/group/collective/group_info_collective.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ void InfoColl::upTree() {
group, is_root, root_node, msg_list.size()
);

auto const& subtree = static_cast<NodeType>(0);
auto const& subtree_zero = static_cast<NodeType>(0);
auto const& extra = static_cast<GroupCollectiveMsg::CountType>(
msg_in_group.size()-1
);
auto msg = makeSharedMessage<GroupCollectiveMsg>(
group,new_root_cont_,true,subtree,root_node,0,extra
group,new_root_cont_,true,subtree_zero,root_node,0,extra
);
theMsg()->sendMsg<GroupCollectiveMsg,newRootHan>(root_node, msg);

Expand Down Expand Up @@ -338,10 +338,10 @@ void InfoColl::upTree() {
auto const& total_subtree = static_cast<NodeType>(subtree + sub);
auto const& level =
msg_in_group.size() == 2 ? msg_in_group[0]->getLevel() + 1 : 0;
auto msg = makeSharedMessage<GroupCollectiveMsg>(
auto cmsg = makeSharedMessage<GroupCollectiveMsg>(
group,op,is_in_group,total_subtree,child,level
);
theMsg()->sendMsg<GroupCollectiveMsg,upHan>(p, msg);
theMsg()->sendMsg<GroupCollectiveMsg,upHan>(p, cmsg);

for (auto&& msg : msg_in_group) {
span_children_.push_back(msg->getChild());
Expand Down
8 changes: 4 additions & 4 deletions src/vt/group/group_info.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ template <typename MsgT>

if (op_id != no_op_id) {
// Send back message
auto msg = makeSharedMessage<GroupOnlyMsg>(group, op_id);
theMsg()->sendMsg<GroupOnlyMsg, Info::groupTriggerHandler>(parent, msg);
auto retmsg = makeSharedMessage<GroupOnlyMsg>(group, op_id);
theMsg()->sendMsg<GroupOnlyMsg, Info::groupTriggerHandler>(parent, retmsg);
}
} else {
debug_print(
Expand Down Expand Up @@ -148,9 +148,9 @@ template <typename MsgT>
parent, op_id
);

auto msg = makeSharedMessage<GroupOnlyMsg>(group, op_id);
auto contmsg = makeSharedMessage<GroupOnlyMsg>(group, op_id);
theMsg()->sendMsg<GroupOnlyMsg, Info::groupTriggerHandler>(
parent, msg
parent, contmsg
);
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/vt/group/group_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,18 @@ EventType GroupManager::sendGroup(
return no_event;
}
} else {
auto iter = remote_group_info_.find(group);
auto remote_iter = remote_group_info_.find(group);

debug_print(
broadcast, node,
"GroupManager::sendGroup: *send* remote size={}, from={}, found={}, "
"dest={}, group={:x}, is_root={} \n",
size, from, iter != remote_group_info_.end(), dest, group,
size, from, remote_iter != remote_group_info_.end(), dest, group,
is_root
);

if (iter != remote_group_info_.end() && (!this_node_dest || first_send)) {
auto& info = *iter->second;
if (remote_iter != remote_group_info_.end() && (!this_node_dest || first_send)) {
auto& info = *remote_iter->second;
vtAssert(!info.is_forward_, "Must not be a forward");
vtAssert(
info.default_spanning_tree_ != nullptr, "Must have spanning tree"
Expand Down
8 changes: 4 additions & 4 deletions src/vt/group/rooted/group_info_rooted.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ void InfoRooted::setupRooted() {
if (finished_setup_action_ != nullptr) {
op = theGroup()->registerContinuation(finished_setup_action_);
}
auto const& size = static_cast<NodeType>(region_list_.size());
auto const& listsize = static_cast<NodeType>(region_list_.size());
region::ShallowList lst(region_list_);
auto msg = makeSharedMessage<GroupListMsg>(
low_node, size, group_, op, size, this_node, &lst
low_node, listsize, group_, op, listsize, this_node, &lst
);
is_forward_ = true;
forward_node_ = low_node;
Expand All @@ -136,9 +136,9 @@ void InfoRooted::setupRooted() {
if (finished_setup_action_ != nullptr) {
op = theGroup()->registerContinuation(finished_setup_action_);
}
auto const& size = static_cast<NodeType>(region_->getSize());
auto const& regsize = static_cast<NodeType>(region_->getSize());
auto msg = makeSharedMessage<GroupRangeMsg>(
low_node, size, group_, op, size, this_node,
low_node, regsize, group_, op, regsize, this_node,
static_cast<region::Range*>(region_.get())
);
is_forward_ = true;
Expand Down
4 changes: 2 additions & 2 deletions src/vt/pipe/interface/remote_container_msg.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void RemoteContainerMsg<MsgT,TupleT>::trigger(MsgU* data) {
pipe, is_send_back, std::tuple_size<decltype(trigger_list_)>()
);
if (is_send_back) {
auto const& pipe = this->getPipe();
triggerSendBack<MsgT>(pipe,data);
auto const& retpipe = this->getPipe();
triggerSendBack<MsgT>(retpipe,data);
} else {
triggerDirect(data);
}
Expand Down
4 changes: 2 additions & 2 deletions src/vt/pipe/pipe_manager_base.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ void PipeManagerBase::addListenerAny(PipeType const& pipe, ListenerT&& fn) {
vtAssert(iter != pipe_state_.end(), "Pipe state must exist");
auto& state = iter->second;
if (!state.hasDispatch()) {
auto fn = [pipe](void* input) {
auto fn2 = [pipe](void* input) {
auto data = reinterpret_cast<typename SignalType::DataPtrType>(input);
signal_holder_<SignalType>.deliverAll(pipe,data);
};
state.setDispatch(fn);
state.setDispatch(fn2);
}
return registerCallback<SignalType>(pipe, std::move(fn));
}
Expand Down
Loading

0 comments on commit 943409a

Please sign in to comment.