Skip to content

Commit eca9e85

Browse files
sbstndbgouarin
authored andcommitted
fix: clean up
1 parent 08588cc commit eca9e85

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

include/samurai/mesh.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121
namespace mpi = boost::mpi;
2222
#endif
2323

24-
// Résolution d'un bug : le découpage est rectangulaire. S'il y a trop de rangs MPI et un min_level trop faible, alors il est parfois
25-
// impossible de décomposer le problème. Il faut alors restreindre un min_level limite
24+
#ifdef SAMURAI_WITH_MPI
25+
// Résolution d'un bug : S'il y a trop de rangs MPI et un min_level trop faible, alors il est parfois
26+
// impossible de décomposer le problème. Il faut alors imposer un min_level limite
2627
bool check_size_min_level(std::size_t min_level)
2728
{
2829
boost::mpi::communicator world;
29-
int size = world.size(); // Nombre total de processus
30+
int size = world.size();
3031

3132
// à vérifier :
3233
// - en 1d ?
@@ -43,16 +44,16 @@ bool check_size_min_level(std::size_t min_level)
4344
return true;
4445
}
4546

46-
void error_on_min_level(std::size_t min_level)
47+
void error_on_mpi_min_level(std::size_t min_level)
4748
{
4849
auto error = check_size_min_level(min_level);
4950
if (error)
5051
{
51-
std::cout << "ERROR: to lot MPI rank for this value of min_level. Please reduce MPI Size or raise min_level according to the rule size <= 2^min_level. "
52-
<< std::endl;
52+
std::cout << "ERROR: Please reduce MPI Size or increase min_value according to the rule mpi_size <= 2^min_level." << std::endl;
5353
MPI_Abort(MPI_COMM_WORLD, 1);
5454
}
5555
}
56+
#endif
5657

5758
namespace samurai
5859
{
@@ -281,7 +282,7 @@ namespace samurai
281282
// load_balancing();
282283

283284
// resolve MPI issue when too lot MPI rank for 2^min_level
284-
error_on_min_level(min_level);
285+
error_on_mpi_min_level(min_level);
285286
#else
286287
this->m_cells[mesh_id_t::cells][start_level] = {start_level, b, approx_box_tol, scaling_factor_};
287288
#endif
@@ -314,7 +315,7 @@ namespace samurai
314315
partition_mesh(start_level, b);
315316
// load_balancing();
316317

317-
error_on_min_level(min_level);
318+
error_on_mpi_min_level(min_level);
318319
#else
319320
this->m_cells[mesh_id_t::cells][start_level] = {start_level, b, approx_box_tol, scaling_factor_};
320321
#endif

0 commit comments

Comments
 (0)