Skip to content

Commit

Permalink
address sanitizer bug fixes, including workaround for issue #427
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny committed Apr 4, 2019
1 parent b8239e9 commit 420ab87
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sstmac/test_skeletons/sstmac_mpi_test_all.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ test_bcast(MPI_Comm comm)
pay = 1234;
}

MPI_Bcast(&pay, count, MPI_DOUBLE, root, comm);
MPI_Bcast(&pay, count, MPI_INT, root, comm);
int recvdata = pay;

if (recvdata != (1234)) {
Expand Down
19 changes: 10 additions & 9 deletions sumi/sim_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -863,23 +863,24 @@ CollectiveEngine::startCollective(Collective* coll)
coll->initActors();
int tag = coll->tag();
Collective::type_t ty = coll->type();
//validate_collective(ty, tag);
Collective*& existing = collectives_[ty][tag];
CollectiveDoneMessage* dmsg;
if (existing){
Collective*& map_entry = collectives_[ty][tag];
Collective* active = nullptr;
CollectiveDoneMessage* dmsg=nullptr;
if (map_entry){
active = map_entry;
coll->start();
dmsg = existing->addActors(coll);
dmsg = active->addActors(coll);
delete coll;
} else {
existing = coll;
map_entry = active = coll;
coll->start();
dmsg = deliverPending(coll, tag, ty);
}

while (dmsg && existing->hasSubsequent()){
while (dmsg && active->hasSubsequent()){
delete dmsg;
existing = existing->popSubsequent();
dmsg = startCollective(existing);
active = active->popSubsequent();
dmsg = startCollective(active);
}

return dmsg;
Expand Down
8 changes: 5 additions & 3 deletions tests/test_std_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using namespace sstmac::sw;

extern "C" int ubuntu_cant_name_mangle() { return 0; }

void fxn1(const char* arg){
void fxn1(const std::string& arg){
std::cout << arg << std::endl;
}

Expand Down Expand Up @@ -81,8 +81,10 @@ void thrash(std::mutex* mtx)

int USER_MAIN(int argc, char** argv)
{
std::thread t1(fxn1, "I got my head checked");
std::thread t2(fxn2, "By a jumbo jet");
std::string str1("I got my head checked");
std::thread t1(fxn1, str1);
std::string str2("By a jumbo jet");
std::thread t2(fxn2, str2);
t1.join();
std::thread t3(fxn3, 3, 5);
t2.join();
Expand Down

0 comments on commit 420ab87

Please sign in to comment.