Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90666014
test_mesh_communicator.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 3, 17:15
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Nov 5, 17:15 (2 d)
Engine
blob
Format
Raw Data
Handle
22116631
Attached To
rAKA akantu
test_mesh_communicator.cc
View Options
/**
* @file test_mesh_communicator.cc
*
* @author Nicolas Richart
*
* @date creation Wed Mar 21 2018
*
* @brief A Documented file.
*
* @section LICENSE
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "mesh.hh"
#include "communicator.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
#if defined(AKANTU_USE_MPI)
# include <mpi.h>
#endif
/* -------------------------------------------------------------------------- */
using
namespace
akantu
;
TEST
(
TestMeshCommunicator
,
Default
)
{
Mesh
mesh
(
3
);
const
Communicator
&
comm
=
mesh
.
getCommunicator
();
ASSERT_EQ
(
comm
.
whoAmI
(),
0
);
ASSERT_EQ
(
comm
.
getNbProc
(),
1
);
}
TEST
(
TestMeshCommunicator
,
Distributed
)
{
Mesh
mesh
(
3
);
mesh
.
distribute
();
int
prank
=
0
,
psize
=
1
;
#if defined(AKANTU_USE_MPI)
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
psize
);
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
prank
);
#endif
const
Communicator
&
comm
=
mesh
.
getCommunicator
();
ASSERT_EQ
(
comm
.
whoAmI
(),
prank
);
ASSERT_EQ
(
comm
.
getNbProc
(),
psize
);
}
Event Timeline
Log In to Comment