1. MPI_Allgatherv, version 0.6.1

2. a little modification
This commit is contained in:
zhangshuai 2019-08-26 14:06:20 +08:00
parent ae1f030a0a
commit aa36a32c94
1 changed files with 16 additions and 37 deletions

View File

@ -1851,47 +1851,26 @@ void World::ModelUpdateSingleLoop()
{
// Update all the models
/// original part
//for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++)
// this->dataPtr->rootElement->GetChild(i)->Update();
for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++)
this->dataPtr->rootElement->GetChild(i)->Update();
/// original part
// test by zhangshuai 2019.07.09 ----Begin
// for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++)
// // Modified by zhangshuai for MPI 2019.07.11 ----Begin
// if (this->flag == 1)
// {
// this->dataPtr->rootElement->GetChild(i)->Update();
// std::cout << "GetChildCount() : " << this->dataPtr->rootElement->GetChildCount() << std::endl;
// std::cout << "GetChild(" << i << ") : " << this->dataPtr->rootElement->GetChild(i)->GetName() << std::endl;
// std::cout << "rootElement->GetName() : " << this->dataPtr->rootElement->GetName() << std::endl;
// std::cout << "this->GetModelCount() : " << this->GetModelCount() << std::endl;
// for (unsigned int i = 0; i < this->GetOwnModelCount(); i++)
// {
// this->GetOwnModel(i)->Update();
// }
// }
// test by zhangshuai 2019.07.09 ----End
// test by zhangshuai 2019.07.10 ----Begin
// for (unsigned int i = 0; i < this->GetModelCount(); i++)
// else
// {
// this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModel(i)->Update();
// this->GetModel(i)->Update();
// std::cout << "this->GetModelCount() : " << this->GetModelCount() << std::endl;
// std::cout << "this->GetModel(i)->GetName() : " << this->GetModel(i)->GetName() << std::endl;
// for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++)
// {
// this->dataPtr->rootElement->GetChild(i)->Update();
// }
// }
// test by zhangshuai 2019.07.10 ----End
// Modified by zhangshuai for MPI 2019.07.11 ----Begin
if (this->flag == 1)
{
for (unsigned int i = 0; i < this->GetOwnModelCount(); i++)
{
this->GetOwnModel(i)->Update();
}
}
else
{
for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++)
{
this->dataPtr->rootElement->GetChild(i)->Update();
}
}
// Modified by zhangshuai for MPI 2019.07.11 ----End
// // Modified by zhangshuai for MPI 2019.07.11 ----End
}
//////////////////////////////////////////////////
@ -1920,9 +1899,9 @@ void World::LoadPlugins()
if (this->flag == 1)
{
// Judge if the model to load is simulated in this gazebo
for (unsigned int i = 0; i < this->GetOwnModelCount(); i++)
for (unsigned int j = 0; j < this->GetOwnModelCount(); j++)
{
if (model->GetName() == this->GetOwnModel(i)->GetName())
if (model->GetName() == this->GetOwnModel(j)->GetName())
model->LoadPlugins();
}
}