Skip to content
Snippets Groups Projects
Commit 02510b9a authored by Matteo Cicuttin's avatar Matteo Cicuttin
Browse files

Removed entity serialization. Objects are too big.

parent 9143d307
No related branches found
No related tags found
No related merge requests found
......@@ -82,23 +82,6 @@ public:
entity(const entity_params& ep);
#ifdef USE_MPI
#ifdef USE_CEREAL_SERIALIZATION
template<typename Archive>
void serialize(Archive& ar)
{
ar(dim, tag, elemType, elemType_2D, g_order, a_order);
ar(parent_dim, parent_tag);
ar(cur_elem_ordering);
ar(reference_cells);
ar(physical_cells);
ar(reference_faces);
ar(physical_faces);
ar(faceTags, faceNodesTags);
}
#endif /* USE_CEREAL_SERIALIZATION */
#endif /* USE_MPI */
double measure(void) const;
matxd mass_matrix(size_t) const;
......
......@@ -10,4 +10,4 @@ Physical Surface("pmc", 11) = {3,4,8,9};
Physical Surface("pec", 12) = {5,6,10,11};
Physical Surface("abc", 13) = {7};
MeshSize{:} = 0.06;
MeshSize{:} = 0.04;
......@@ -3,10 +3,10 @@
sim.name = "twomat" -- simulation name
sim.dt = 1e-12 -- timestep size
sim.timesteps = 200 -- num of iterations
sim.timesteps = 20000 -- num of iterations
sim.gmsh_model = "parallel_plate.geo" -- gmsh model filename
sim.use_gpu = 0 -- 0: cpu, 1: gpu
sim.approx_order = 1 -- approximation order
sim.approx_order = 2 -- approximation order
sim.time_integrator = "leapfrog"
postpro.silo_output_rate = 100
postpro.cycle_print_rate = 100 -- console print rate
......
......@@ -1026,17 +1026,6 @@ entity::populate_entity_data(entity_data_cpu& ed, const model& mod) const
void
entity::mpi_send(int dst, MPI_Comm comm)
{
#ifdef USE_CEREAL_SERIALIZATION
std::stringstream ss;
{
cereal::BinaryOutputArchive oarch(ss);
oarch(*this);
}
std::cout << "Sending " << dim << ", " << tag;
std::cout << ": " << ss.str().size() << std::endl;
MPI_Send( ss.str().c_str(), ss.str().size(), MPI_CHAR, dst, 0, comm );
#else /* USE_CEREAL_SERIALIZATION */
/* Here (and in the nested objects) we are doing a lot of small
* MPI_Send() and this could be really inefficient. This code however
* runs only at the beginning of the simulation and thus for now it
......@@ -1077,32 +1066,11 @@ entity::mpi_send(int dst, MPI_Comm comm)
priv_MPI_Send(faceTags, dst, comm);
priv_MPI_Send(faceNodesTags, dst, comm);
#endif /* USE_CEREAL_SERIALIZATION */
}
void
entity::mpi_recv(int src, MPI_Comm comm)
{
#ifdef USE_CEREAL_SERIALIZATION
MPI_Status stat;
MPI_Probe(src, 0, comm, &stat);
int count;
MPI_Get_count(&stat, MPI_CHAR, &count);
std::string str;
str.resize(count+1);
MPI_Recv(str.data(), count, MPI_CHAR, src, 0, comm, MPI_STATUS_IGNORE);
std::stringstream ss;
ss << str;
{
cereal::BinaryInputArchive iarch(ss);
iarch(*this);
}
#else /* USE_CEREAL_SERIALIZATION */
MPI_Recv(&dim, 1, MPI_INT, src, 0, comm, MPI_STATUS_IGNORE);
MPI_Recv(&tag, 1, MPI_INT, src, 0, comm, MPI_STATUS_IGNORE);
MPI_Recv(&elemType, 1, MPI_INT, src, 0, comm, MPI_STATUS_IGNORE);
......@@ -1138,7 +1106,6 @@ entity::mpi_recv(int src, MPI_Comm comm)
priv_MPI_Recv(faceTags, src, comm);
priv_MPI_Recv(faceNodesTags, src, comm);
#endif /* USE_CEREAL_SERIALIZATION */
}
#endif /* USE_MPI */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment