Hi all,
I have written the following failing minimal example (also attached) where
I create a single element parallel distributed triangulation and try to
write and read a double.
*using namespace dealii;*
*int main (int argc, char *argv[])*
*{*
* Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);*
* const double L=20;*
* parallel::distributed::Triangulation<3> triangulation(MPI_COMM_WORLD);*
* GridGenerator::hyper_cube (triangulation, -L, L);*
* unsigned int offset = triangulation.register_data_attach*
* (sizeof(double),*
*[&](const typename
dealii::parallel::distributed::Triangulation<3>::cell_iterator &cell,*
*const typename
dealii::parallel::distributed::Triangulation<3>::CellStatus status,*
*void * data) -> void*
*{*
* double* dataStore = reinterpret_cast(data);*
* *dataStore=0.0;*
*}*
*);*
* std::cout<< "offset=" << offset << std::endl;*
* std::string filename="triangulationChk";*
* triangulation.save(filename.c_str());*
* triangulation.load(filename.c_str());*
* triangulation.notify_ready_to_unpack*
* (offset,[&](const typename
dealii::parallel::distributed::Triangulation<3>::cell_iterator &cell,*
* const typename
dealii::parallel::distributed::Triangulation<3>::CellStatus status,*
* const void * data) -> void*
* {*
* }*
*);*
*}*
I get the following error:
*An error occurred in line <3236> of file
in function*
*void dealii::parallel::distributed::Triangulation::notify_ready_to_unpack(unsigned int, const std::function::cell_iterator &,
dealii::Triangulation::CellStatus, const void *)> &) [with
int dim = 3, int spacedim = 3]*
*The violated condition was: *
*offset < sizeof(CellStatus)+attached_data_size*
*Additional information: *
*invalid offset in notify_ready_to_unpack()*
I am wondering if I am missing something in my implementation.
Thanks,
Sambit
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
//Include all deal.II header file
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//Include generic C++ headers
#include
#include
using namespace dealii;
int main (int argc, char *argv[])
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
const double L=20;
parallel::distributed::Triangulation<3> triangulation(MPI_COMM_WORLD);
GridGenerator::hyper_cube (triangulation, -L, L);
unsigned int offset = triangulation.register_data_attach
(sizeof(double),
[&](const typename dealii::parallel::distributed::Triangulation<3>::cell_iterator &cell,
const typename dealii::parallel::distributed::Triangulation<3>::CellStatus status,
void * data) -> void
{
double* dataStore = reinterpret_cast(data);
*dataStore=0.0;
}
);
std::cout<< "offset=" << offset << std::endl;
std::string filename="triangulationChk";
triangulation.save(filename.c_str());
triangulation.load(filename.c_str());
triangulation.notify_ready_to_unpack
(offset,[&](const typename dealii::parallel::distributed::Triangulation<3>::cell_iterator &cell,
const typename dealii::parallel::distributed::Triangulation<3>::CellStatus status,
const void * data) -> void
{
}
);
}