Commit e2ab7bbe authored by incardon's avatar incardon
Browse files

Fixing bug no resize of status vector potentially memory corruption

parent 6ba41e3e
...@@ -406,7 +406,12 @@ public: ...@@ -406,7 +406,12 @@ public:
{ {
int err = 0; int err = 0;
// if req == 0 return
if (req.size() == 0)
return;
// Wait for all the requests // Wait for all the requests
stat.resize(req.size());
err = MPI_Waitall(req.size(),&req.get(0),&stat.get(0)); err = MPI_Waitall(req.size(),&req.get(0),&stat.get(0));
// MPI error get the message and abort MPI // MPI error get the message and abort MPI
......
...@@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv) ...@@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv)
else else
p_id = p_id % n_proc; p_id = p_id % n_proc;
if (p_id != vcl.getProcessUnitID()) if (p_id != (long int)vcl.getProcessUnitID())
recv_message.get(p_id).resize(j); recv_message.get(p_id).resize(j);
} }
...@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv) ...@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv)
else else
p_id = p_id % n_proc; p_id = p_id % n_proc;
if (p_id != vcl.getProcessUnitID()) if (p_id != (long int)vcl.getProcessUnitID())
{ {
std::ostringstream msg; std::ostringstream msg;
msg << "Hello from " << p_id << " to " << vcl.getProcessUnitID(); msg << "Hello from " << p_id << " to " << vcl.getProcessUnitID();
...@@ -407,7 +407,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv) ...@@ -407,7 +407,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv)
else else
p_id = p_id % n_proc; p_id = p_id % n_proc;
if (p_id != vcl.getProcessUnitID()) if (p_id != (long int)vcl.getProcessUnitID())
recv_message.get(p_id).resize(j); recv_message.get(p_id).resize(j);
} }
...@@ -433,7 +433,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv) ...@@ -433,7 +433,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv)
#endif #endif
// Check the message // Check the message
for (long int i = 0 ; i < 8 && i < n_proc ; i++) for (long int i = 0 ; i < 8 && i < (long int)n_proc ; i++)
{ {
long int p_id = (- (i+1) * ps + (long int)vcl.getProcessUnitID()); long int p_id = (- (i+1) * ps + (long int)vcl.getProcessUnitID());
if (p_id < 0) if (p_id < 0)
...@@ -441,7 +441,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv) ...@@ -441,7 +441,7 @@ BOOST_AUTO_TEST_CASE( VCluster_use_sendrecv)
else else
p_id = p_id % n_proc; p_id = p_id % n_proc;
if (p_id != vcl.getProcessUnitID()) if (p_id != (long int)vcl.getProcessUnitID())
{ {
std::ostringstream msg; std::ostringstream msg;
msg << "Hello from " << p_id << " to " << vcl.getProcessUnitID(); msg << "Hello from " << p_id << " to " << vcl.getProcessUnitID();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment