From cf29f6c2bd11726696ab819776d01ae07a8e697c Mon Sep 17 00:00:00 2001 From: zhangshuai Date: Thu, 30 May 2019 09:33:24 +0800 Subject: [PATCH] MPI_ALLGATHERV test2 --- Gazebo_Distributed_MPI/gazebo/physics/World.cc | 9 ++++++--- Gazebo_Distributed_MPI/mpi_run/MPI_Gazebo_launch.sh | 2 +- Gazebo_Distributed_MPI/mpi_run/hostfile | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Gazebo_Distributed_MPI/gazebo/physics/World.cc b/Gazebo_Distributed_MPI/gazebo/physics/World.cc index e1d7666..15675d7 100644 --- a/Gazebo_Distributed_MPI/gazebo/physics/World.cc +++ b/Gazebo_Distributed_MPI/gazebo/physics/World.cc @@ -935,8 +935,8 @@ void World::Update() std::string tmp_model_name = this->distribution->GetGazeboIDPtr(this->gazeboLocalID)->GetModelName(i); modelPose->set_name(tmp_model_name); - if (this->gazeboLocalID == tmp_gazebo_id) - { + // if (this->gazeboLocalID == tmp_gazebo_id) + // { modelPose->set_id(this->GetModel(tmp_model_name)->GetLink("canonical")->GetId()); modelPose->mutable_position()->set_x(this->GetModel(tmp_model_name)->GetLink("canonical")->GetWorldPose().pos.x); modelPose->mutable_position()->set_y(this->GetModel(tmp_model_name)->GetLink("canonical")->GetWorldPose().pos.y); @@ -945,7 +945,7 @@ void World::Update() modelPose->mutable_orientation()->set_y(this->GetModel(tmp_model_name)->GetLink("canonical")->GetWorldPose().rot.y); modelPose->mutable_orientation()->set_z(this->GetModel(tmp_model_name)->GetLink("canonical")->GetWorldPose().rot.z); modelPose->mutable_orientation()->set_w(this->GetModel(tmp_model_name)->GetLink("canonical")->GetWorldPose().rot.w); - } + // } tmp_model_name.clear(); } @@ -1045,6 +1045,9 @@ void World::Update() } } + delete[] sendBuffer; + delete[] receiveBuffer; + // Added by zhangshuai 2019.04.03 for count time ----Begin #ifdef USE_COUNT_TIME gettimeofday(&tv, NULL); diff --git a/Gazebo_Distributed_MPI/mpi_run/MPI_Gazebo_launch.sh b/Gazebo_Distributed_MPI/mpi_run/MPI_Gazebo_launch.sh index b94a9dd..4a0669d 100755 --- a/Gazebo_Distributed_MPI/mpi_run/MPI_Gazebo_launch.sh +++ b/Gazebo_Distributed_MPI/mpi_run/MPI_Gazebo_launch.sh @@ -81,7 +81,7 @@ do echo "${hosts[$i]}:start_good" done -sleep 5m +sleep 3m #登入各节点kill相关进程以结束仿真(1.目前方式比较暴力,后续改进;2.cd ~/MPI 还要进行灵活性优化) for((i=0;i