Skip to content

Commit 41feecb

Browse files
cyanmcgChao Yan
andauthored
fix compiler complaints (#140)
Co-authored-by: Chao Yan <cyan@uottawa.ca>
1 parent 1bed06d commit 41feecb

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/dg/dg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ double DGBase<dim,real,MeshType>::get_residual_linfnorm () const
13841384
update_flags);
13851385

13861386
// Obtain the mapping from local dof indices to global dof indices
1387-
for (const auto cell : dof_handler.active_cell_iterators()) {
1387+
for (const auto& cell : dof_handler.active_cell_iterators()) {
13881388
if (!cell->is_locally_owned()) continue;
13891389

13901390
const int i_fele = cell->active_fe_index();
@@ -1439,7 +1439,7 @@ double DGBase<dim,real,MeshType>::get_residual_l2norm () const
14391439
update_flags);
14401440

14411441
// Obtain the mapping from local dof indices to global dof indices
1442-
for (const auto cell : dof_handler.active_cell_iterators()) {
1442+
for (const auto& cell : dof_handler.active_cell_iterators()) {
14431443
if (!cell->is_locally_owned()) continue;
14441444

14451445
const int i_fele = cell->active_fe_index();

src/mesh/high_order_grid.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ void HighOrderGrid<dim,real,MeshType,VectorType,DoFHandlerType>::update_surface_
10811081

10821082
n_locally_owned_surface_nodes_per_mpi.clear();
10831083
n_locally_owned_surface_nodes_per_mpi.resize(n_mpi);
1084-
MPI_Allgather(&n_locally_owned_surface_nodes, 1, MPI::UNSIGNED, &(n_locally_owned_surface_nodes_per_mpi[0]), 1, MPI::UNSIGNED, MPI_COMM_WORLD);
1084+
MPI_Allgather(&n_locally_owned_surface_nodes, 1, MPI_UNSIGNED, &(n_locally_owned_surface_nodes_per_mpi[0]), 1, MPI_UNSIGNED, MPI_COMM_WORLD);
10851085

10861086
std::vector<std::vector<real>> vector_locally_owned_surface_nodes(n_mpi);
10871087
std::vector<std::vector<unsigned int>> vector_locally_owned_surface_indices(n_mpi);
@@ -1097,7 +1097,7 @@ void HighOrderGrid<dim,real,MeshType,VectorType,DoFHandlerType>::update_surface_
10971097

10981098
for (int i_mpi=0; i_mpi<n_mpi; ++i_mpi) {
10991099
MPI_Bcast(&(vector_locally_owned_surface_nodes[i_mpi][0]), n_locally_owned_surface_nodes_per_mpi[i_mpi], MPI_DOUBLE, i_mpi, MPI_COMM_WORLD);
1100-
MPI_Bcast(&(vector_locally_owned_surface_indices[i_mpi][0]), n_locally_owned_surface_nodes_per_mpi[i_mpi], MPI::UNSIGNED, i_mpi, MPI_COMM_WORLD);
1100+
MPI_Bcast(&(vector_locally_owned_surface_indices[i_mpi][0]), n_locally_owned_surface_nodes_per_mpi[i_mpi], MPI_UNSIGNED, i_mpi, MPI_COMM_WORLD);
11011101
}
11021102

11031103
all_surface_nodes = flatten(vector_locally_owned_surface_nodes);
@@ -1127,7 +1127,7 @@ void HighOrderGrid<dim,real,MeshType,VectorType,DoFHandlerType>::update_surface_
11271127
}
11281128

11291129
std::vector<unsigned int> n_locally_relevant_surface_nodes_per_mpi(n_mpi);
1130-
MPI_Allgather(&n_locally_relevant_surface_nodes, 1, MPI::UNSIGNED, &(n_locally_relevant_surface_nodes_per_mpi[0]), 1, MPI::UNSIGNED, MPI_COMM_WORLD);
1130+
MPI_Allgather(&n_locally_relevant_surface_nodes, 1, MPI_UNSIGNED, &(n_locally_relevant_surface_nodes_per_mpi[0]), 1, MPI_UNSIGNED, MPI_COMM_WORLD);
11311131

11321132
}
11331133

tests/unit_tests/grid/make_cells_valid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ int main (int argc, char * argv[])
151151
}
152152

153153
bool mpi_has_invalid_poly;
154-
MPI_Allreduce(&has_invalid_poly, &mpi_has_invalid_poly, 1, MPI::BOOL, MPI_LOR, MPI_COMM_WORLD);
154+
MPI_Allreduce(&has_invalid_poly, &mpi_has_invalid_poly, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD);
155155

156156
return mpi_has_invalid_poly;
157157
}

tests/unit_tests/sensitivities/d2RdWdW_fd_vs_ad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int test (
143143

144144
const bool local_isnonzero = sparsity_pattern.exists(iw,jw);
145145
bool global_isnonzero;
146-
MPI_Allreduce(&local_isnonzero, &global_isnonzero, 1, MPI::BOOL, MPI_LOR, MPI_COMM_WORLD);
146+
MPI_Allreduce(&local_isnonzero, &global_isnonzero, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD);
147147
if (!global_isnonzero) continue;
148148

149149
const bool iw_relevant = dg->locally_relevant_dofs.is_element(iw);

tests/unit_tests/sensitivities/d2RdWdX_fd_vs_ad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int test (
111111

112112
const bool local_isnonzero = sparsity_pattern.exists(iw,jnode);
113113
bool global_isnonzero;
114-
MPI_Allreduce(&local_isnonzero, &global_isnonzero, 1, MPI::BOOL, MPI_LOR, MPI_COMM_WORLD);
114+
MPI_Allreduce(&local_isnonzero, &global_isnonzero, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD);
115115
if (!global_isnonzero) continue;
116116

117117
const bool iw_relevant = dg->locally_relevant_dofs.is_element(iw);

tests/unit_tests/sensitivities/d2RdXdX_fd_vs_ad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ int test (
151151

152152
const bool local_isnonzero = sparsity_pattern.exists(inode,jnode);
153153
bool global_isnonzero;
154-
MPI_Allreduce(&local_isnonzero, &global_isnonzero, 1, MPI::BOOL, MPI_LOR, MPI_COMM_WORLD);
154+
MPI_Allreduce(&local_isnonzero, &global_isnonzero, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD);
155155
if (!global_isnonzero) continue;
156156

157157
const bool inode_relevant = high_order_grid->locally_relevant_dofs_grid.is_element(inode);

0 commit comments

Comments
 (0)