I'm trying to send this structure through MPI, but I don't know if that's right.
struct Node {
int sum_node;
int depth_node;
vector<vector<int> > subset;
vector<int> sum_subset;
vector<int> depth_subset;
};
Sending like this:
Node zz = stack.back();
stack.pop_back();
MPI_Send(&zz, sizeof(struct Node), MPI_BYTE, 1, MSG_WORK_SENT, MPI_COMM_WORLD);
Receiving like this:
Node gg;
MPI_Recv(&gg, sizeof(struct Node), MPI_BYTE, status.MPI_SOURCE, MSG_WORK_SENT, MPI_COMM_WORLD, &status);
stack.push_back(gg);
And program terminated with Segmentation fault. Can anyone help me, please?
std::vectorwill have a pointer to a chunk of memory that will lie outside of aNodeinstance.