Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to XDMFEntry to use uint64_t data types #13626

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 20 additions & 20 deletions include/deal.II/base/data_out_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -3321,33 +3321,33 @@ class XDMFEntry
* cases where <code>solution_filename == mesh_filename</code>, and
* <code>dim==spacedim</code>.
*/
XDMFEntry(const std::string &filename,
const double time,
const unsigned int nodes,
const unsigned int cells,
const unsigned int dim);
XDMFEntry(const std::string & filename,
const double time,
const std::uint64_t nodes,
const std::uint64_t cells,
const unsigned int dim);

/**
* Simplified constructor that calls the complete constructor for
* cases where <code>dim==spacedim</code>.
*/
XDMFEntry(const std::string &mesh_filename,
const std::string &solution_filename,
const double time,
const unsigned int nodes,
const unsigned int cells,
const unsigned int dim);
XDMFEntry(const std::string & mesh_filename,
const std::string & solution_filename,
const double time,
const std::uint64_t nodes,
const std::uint64_t cells,
const unsigned int dim);

/**
* Constructor that sets all members to provided parameters.
*/
XDMFEntry(const std::string &mesh_filename,
const std::string &solution_filename,
const double time,
const unsigned int nodes,
const unsigned int cells,
const unsigned int dim,
const unsigned int spacedim);
XDMFEntry(const std::string & mesh_filename,
const std::string & solution_filename,
const double time,
const std::uint64_t nodes,
const std::uint64_t cells,
const unsigned int dim,
const unsigned int spacedim);

/**
* Record an attribute and associated dimensionality.
Expand Down Expand Up @@ -3411,12 +3411,12 @@ class XDMFEntry
/**
* The number of data nodes.
*/
unsigned int num_nodes;
std::uint64_t num_nodes;

/**
* The number of data cells.
*/
unsigned int num_cells;
std::uint64_t num_cells;

/**
* The dimension associated with the data.
Expand Down
40 changes: 20 additions & 20 deletions source/base/data_out_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7895,7 +7895,7 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
const double cur_time,
const MPI_Comm & comm) const
{
unsigned int local_node_cell_count[2], global_node_cell_count[2];
std::uint64_t local_node_cell_count[2], global_node_cell_count[2];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also have to fix the data type of the MPI call a couple of lines down from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, good catch. Should be fixed now!


#ifndef DEAL_II_WITH_HDF5
// throw an exception, but first make sure the compiler does not warn about
Expand All @@ -7919,7 +7919,7 @@ DataOutInterface<dim, spacedim>::create_xdmf_entry(
int ierr = MPI_Allreduce(local_node_cell_count,
global_node_cell_count,
2,
MPI_UNSIGNED,
MPI_UINT64_T,
MPI_SUM,
comm);
AssertThrowMPI(ierr);
Expand Down Expand Up @@ -9075,34 +9075,34 @@ XDMFEntry::XDMFEntry()



XDMFEntry::XDMFEntry(const std::string &filename,
const double time,
const unsigned int nodes,
const unsigned int cells,
const unsigned int dim)
XDMFEntry::XDMFEntry(const std::string & filename,
const double time,
const std::uint64_t nodes,
const std::uint64_t cells,
const unsigned int dim)
: XDMFEntry(filename, filename, time, nodes, cells, dim, dim)
{}



XDMFEntry::XDMFEntry(const std::string &mesh_filename,
const std::string &solution_filename,
const double time,
const unsigned int nodes,
const unsigned int cells,
const unsigned int dim)
XDMFEntry::XDMFEntry(const std::string & mesh_filename,
const std::string & solution_filename,
const double time,
const std::uint64_t nodes,
const std::uint64_t cells,
const unsigned int dim)
: XDMFEntry(mesh_filename, solution_filename, time, nodes, cells, dim, dim)
{}



XDMFEntry::XDMFEntry(const std::string &mesh_filename,
const std::string &solution_filename,
const double time,
const unsigned int nodes,
const unsigned int cells,
const unsigned int dim,
const unsigned int spacedim)
XDMFEntry::XDMFEntry(const std::string & mesh_filename,
const std::string & solution_filename,
const double time,
const std::uint64_t nodes,
const std::uint64_t cells,
const unsigned int dim,
const unsigned int spacedim)
: valid(true)
, h5_sol_filename(solution_filename)
, h5_mesh_filename(mesh_filename)
Expand Down