}
# endif
const int ierr =
- MPI_Allreduce(values != output ?
- DEAL_II_MPI_CONST_CAST(values.data()) :
- MPI_IN_PLACE,
+ MPI_Allreduce(values != output ? values.data() : MPI_IN_PLACE,
static_cast<void *>(output.data()),
static_cast<int>(values.size()),
mpi_type_id(values.data()),
int ierr = MPI_Info_create(&info);
AssertThrowMPI(ierr);
MPI_File fh;
- ierr = MPI_File_open(comm,
- DEAL_II_MPI_CONST_CAST(filename.c_str()),
- MPI_MODE_CREATE | MPI_MODE_WRONLY,
- info,
- &fh);
+ ierr = MPI_File_open(
+ comm, filename.c_str(), MPI_MODE_CREATE | MPI_MODE_WRONLY, info, &fh);
AssertThrow(ierr == MPI_SUCCESS, ExcFileNotOpen(filename));
ierr = MPI_File_set_size(fh, 0); // delete the file contents
header_size = ss.str().size();
// Write the header on rank 0 and automatically move the
// shared file pointer to the location after header;
- ierr = MPI_File_write_shared(fh,
- DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
- header_size,
- MPI_CHAR,
- MPI_STATUS_IGNORE);
+ ierr = MPI_File_write_shared(
+ fh, ss.str().c_str(), header_size, MPI_CHAR, MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
}
vtk_flags,
ss);
- ierr = MPI_File_write_ordered(fh,
- DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
- ss.str().size(),
- MPI_CHAR,
- MPI_STATUS_IGNORE);
+ ierr = MPI_File_write_ordered(
+ fh, ss.str().c_str(), ss.str().size(), MPI_CHAR, MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
}
std::stringstream ss;
DataOutBase::write_vtu_footer(ss);
unsigned int footer_size = ss.str().size();
- ierr = MPI_File_write_shared(fh,
- DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
- footer_size,
- MPI_CHAR,
- MPI_STATUS_IGNORE);
+ ierr = MPI_File_write_shared(
+ fh, ss.str().c_str(), footer_size, MPI_CHAR, MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
}
ierr = MPI_File_close(&fh);
// Open file.
MPI_File fh;
ierr = MPI_File_open(this->mpi_communicator,
- DEAL_II_MPI_CONST_CAST(fname_tria.c_str()),
+ fname_tria.c_str(),
MPI_MODE_CREATE | MPI_MODE_WRONLY,
info,
&fh);
// Write offsets to file.
ierr = MPI_File_write_at(fh,
myrank * sizeof(unsigned int),
- DEAL_II_MPI_CONST_CAST(&buffer_size),
+ &buffer_size,
1,
MPI_UNSIGNED,
MPI_STATUS_IGNORE);
ierr = MPI_File_write_at(fh,
mpisize * sizeof(unsigned int) +
offset, // global position in file
- DEAL_II_MPI_CONST_CAST(buffer.data()),
+ buffer.data(),
buffer.size(), // local buffer
MPI_CHAR,
MPI_STATUS_IGNORE);
MPI_File fh;
ierr = MPI_File_open(this->mpi_communicator,
- DEAL_II_MPI_CONST_CAST(fname_tria.c_str()),
+ fname_tria.c_str(),
MPI_MODE_RDONLY,
info,
&fh);
ierr = MPI_File_read_at(fh,
myrank * sizeof(unsigned int),
- DEAL_II_MPI_CONST_CAST(&buffer_size),
+ &buffer_size,
1,
MPI_UNSIGNED,
MPI_STATUS_IGNORE);
ierr = MPI_File_read_at(fh,
mpisize * sizeof(unsigned int) +
offset, // global position in file
- DEAL_II_MPI_CONST_CAST(buffer.data()),
+ buffer.data(),
buffer.size(), // local buffer
MPI_CHAR,
MPI_STATUS_IGNORE);
MPI_File fh;
ierr = MPI_File_open(mpi_communicator,
- DEAL_II_MPI_CONST_CAST(fname_fixed.c_str()),
+ fname_fixed.c_str(),
MPI_MODE_CREATE | MPI_MODE_WRONLY,
info,
&fh);
{
ierr = MPI_File_write_at(fh,
0,
- DEAL_II_MPI_CONST_CAST(
- sizes_fixed_cumulative.data()),
+ sizes_fixed_cumulative.data(),
sizes_fixed_cumulative.size(),
MPI_UNSIGNED,
MPI_STATUS_IGNORE);
if (src_data_fixed.size() <=
static_cast<std::size_t>(std::numeric_limits<int>::max()))
{
- ierr =
- MPI_File_write_at(fh,
- my_global_file_position,
- DEAL_II_MPI_CONST_CAST(src_data_fixed.data()),
- src_data_fixed.size(),
- MPI_BYTE,
- MPI_STATUS_IGNORE);
+ ierr = MPI_File_write_at(fh,
+ my_global_file_position,
+ src_data_fixed.data(),
+ src_data_fixed.size(),
+ MPI_BYTE,
+ MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
}
else
ierr =
MPI_File_write_at(fh,
my_global_file_position,
- DEAL_II_MPI_CONST_CAST(src_data_fixed.data()),
+ src_data_fixed.data(),
1,
*Utilities::MPI::create_mpi_data_type_n_bytes(
src_data_fixed.size()),
MPI_File fh;
ierr = MPI_File_open(mpi_communicator,
- DEAL_II_MPI_CONST_CAST(fname_variable.c_str()),
+ fname_variable.c_str(),
MPI_MODE_CREATE | MPI_MODE_WRONLY,
info,
&fh);
std::numeric_limits<int>::max()),
ExcNotImplemented());
- ierr =
- MPI_File_write_at(fh,
- my_global_file_position,
- DEAL_II_MPI_CONST_CAST(src_sizes_variable.data()),
- src_sizes_variable.size(),
- MPI_INT,
- MPI_STATUS_IGNORE);
+ ierr = MPI_File_write_at(fh,
+ my_global_file_position,
+ src_sizes_variable.data(),
+ src_sizes_variable.size(),
+ MPI_INT,
+ MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
}
// to avoid overflow for files larger than 4GB:
const std::uint64_t size_on_proc = src_data_variable.size();
std::uint64_t prefix_sum = 0;
- ierr = MPI_Exscan(DEAL_II_MPI_CONST_CAST(&size_on_proc),
+ ierr = MPI_Exscan(&size_on_proc,
&prefix_sum,
1,
MPI_UINT64_T,
{
ierr = MPI_File_write_at(fh,
my_global_file_position,
- DEAL_II_MPI_CONST_CAST(
- src_data_variable.data()),
+ src_data_variable.data(),
src_data_variable.size(),
MPI_BYTE,
MPI_STATUS_IGNORE);
ierr =
MPI_File_write_at(fh,
my_global_file_position,
- DEAL_II_MPI_CONST_CAST(
- src_data_variable.data()),
+ src_data_variable.data(),
1,
*Utilities::MPI::create_mpi_data_type_n_bytes(
src_data_variable.size()),
AssertThrowMPI(ierr);
MPI_File fh;
- ierr = MPI_File_open(mpi_communicator,
- DEAL_II_MPI_CONST_CAST(fname_fixed.c_str()),
- MPI_MODE_RDONLY,
- info,
- &fh);
+ ierr = MPI_File_open(
+ mpi_communicator, fname_fixed.c_str(), MPI_MODE_RDONLY, info, &fh);
AssertThrowMPI(ierr);
ierr = MPI_Info_free(&info);
AssertThrowMPI(ierr);
MPI_File fh;
- ierr = MPI_File_open(mpi_communicator,
- DEAL_II_MPI_CONST_CAST(fname_variable.c_str()),
- MPI_MODE_RDONLY,
- info,
- &fh);
+ ierr = MPI_File_open(
+ mpi_communicator, fname_variable.c_str(), MPI_MODE_RDONLY, info, &fh);
AssertThrowMPI(ierr);
ierr = MPI_Info_free(&info);
0ULL);
std::uint64_t prefix_sum = 0;
- ierr = MPI_Exscan(DEAL_II_MPI_CONST_CAST(&size_on_proc),
+ ierr = MPI_Exscan(&size_on_proc,
&prefix_sum,
1,
MPI_UINT64_T,
// --------- Phase 4: shift indices so that each processor has a unique
// range of indices
dealii::types::global_dof_index my_shift = 0;
- const int ierr =
- MPI_Exscan(DEAL_II_MPI_CONST_CAST(&n_locally_owned_dofs),
- &my_shift,
- 1,
- DEAL_II_DOF_INDEX_MPI_TYPE,
- MPI_SUM,
- triangulation->get_communicator());
+ const int ierr = MPI_Exscan(&n_locally_owned_dofs,
+ &my_shift,
+ 1,
+ DEAL_II_DOF_INDEX_MPI_TYPE,
+ MPI_SUM,
+ triangulation->get_communicator());
AssertThrowMPI(ierr);
// make dof indices globally consecutive
//* 3. communicate local dofcount and shift ids to make
// them unique
dealii::types::global_dof_index my_shift = 0;
- int ierr = MPI_Exscan(DEAL_II_MPI_CONST_CAST(
- &level_number_cache.n_locally_owned_dofs),
+ int ierr = MPI_Exscan(&level_number_cache.n_locally_owned_dofs,
&my_shift,
1,
DEAL_II_DOF_INDEX_MPI_TYPE,
const int n = 1;
const std::vector<int> ranks(n, rank);
MPI_Group group_B;
- MPI_Group_incl(group_A, n, DEAL_II_MPI_CONST_CAST(ranks.data()), &group_B);
+ MPI_Group_incl(group_A, n, ranks.data(), &group_B);
MPI_Comm communicator_B;
const int mpi_tag = Utilities::MPI::internal::Tags::scalapack_copy_from;
const int n = 1;
const std::vector<int> ranks(n, rank);
MPI_Group group_B;
- MPI_Group_incl(group_A, n, DEAL_II_MPI_CONST_CAST(ranks.data()), &group_B);
+ MPI_Group_incl(group_A, n, ranks.data(), &group_B);
MPI_Comm communicator_B;
const int mpi_tag = Utilities::MPI::internal::Tags::scalapack_copy_to;
unsigned int idx = 0;
for (const auto &sparsity_line : send_data)
{
- const int ierr =
- MPI_Isend(DEAL_II_MPI_CONST_CAST(sparsity_line.second.data()),
- sparsity_line.second.size(),
- DEAL_II_DOF_INDEX_MPI_TYPE,
- sparsity_line.first,
- mpi_tag,
- mpi_comm,
- &requests[idx++]);
+ const int ierr = MPI_Isend(sparsity_line.second.data(),
+ sparsity_line.second.size(),
+ DEAL_II_DOF_INDEX_MPI_TYPE,
+ sparsity_line.first,
+ mpi_tag,
+ mpi_comm,
+ &requests[idx++]);
AssertThrowMPI(ierr);
}
}