Hi, I don't want to make my code public at this moment. It looks hard to find a minimal example, since the error happens only now and then. I'll try to stick to the C Bindings and skip the serialization stuff. Thanks for the help. Regards, Martin Matthias Troyer wrote:
On 21 Sep 2010, at 10:59, Martin Huenniger wrote:
Hi,
so here are the pieces of code that cause the problem:
The following routine is the main loop of the master process. It dispatches the data to and from the worker processes:
'''
At the very same time the worker processes run the next routine. They receive a ball from the master and explore it. During exploration new found balls are sent back to the master.
...
Communication from master to worker is implemented in the next snippet. That is the code that generates the output provided in the last mail.
The idea is the following: Since the boost::mpi::communicator::send() and boost::mpi::communicator::recv() routines refuse to work with my serialization, I implemented the communication using the C Bindings of MPI. So the data gets serialized in some text_[io]archive over a std::stringstream (binary_[io]archive isn't working), and the string extracted from this stringstream is sent over the communication channel. On receiving it gets corrupted sometimes. ...
The template-parameters Jobtype and Restype are instatiated to Ball<double>.
I read elsewhere that using text_archives with doubles is generally a bad idea since receiving NaN's and inf's is not possible. As the output in the last mail shows, this was not the case. Maybe you have an idea what is causing the trouble with the binary_archive, because using these would seem a lot more safer to me.
Can you just attach a tarball or single source file instead of code fragments
Matthias