0
votes

I would like to ask if someone knows a boost::mpi documentation for beginners? (i already read Boost.MPI documentation from the Internet site).

a bit about my system, i have a claster of about 90 knots, each knot have two CPU with two cores (4 cores together) and 4Gb ram.

i would like to define shared memory to each knot and there store a vector std::vector<bool> occupation;. Then each process need to compute something based on his rank() number.

Now, all the multi Process need to wait until all the cores are done computing and then send a vector, std::vector<uint32_t> remove;, to the main process (rank() == 0) which will update vector occupation and then send to all the knots the new occupation vector.

It could be that it would better to use simply mpi.h instead of boost::mpi.

I would like to hear your opinion, since i don't have experience in this area of MPI.

2

2 Answers

0
votes

Consider using OpenMP for the shared-memory part if your compiler supports it, then setting up one process per node that does what four processes what do in your current setup. MPI wasn't really designed for shared memory.

0
votes

As mentioned by larsmans, you can't really do shared memory with MPI. But it sounds like you don't really need distributed shared memory; it sounds like all of the tasks need to get a copy of occupation at the start, do their calculations, send their results back to the master in the form of remove, and the master then broadcasts an updated copy of occupation. MPI can do that just fine.

A way to start would be to have the master process use broadcast to do the initial sending of data, have the worker processes use send to send the updates back to the master, and have the master recv the data from each task; when that's done, the cycle repeats itself.