Boost logo

Boost :

Subject: Re: [boost] [serialization] failing MPI build
From: Alain Miniussi (alain.miniussi_at_[hidden])
Date: 2015-04-15 11:41:23


in basic_iarchive::load_preamble the class_id is actually an
class_id_optional_type, and as such ends up being ignored at mpi's
  // input archives need to ignore the optional information
 

=>void load_override(archive::class_id_optional_type & /*t*/){}

But it was actually inserted in the archive, which ends up in a shift of
2 bytes when reading the size.

On 15/04/2015 16:27, Alain Miniussi wrote:
> On 15/04/2015 15:55, Alain Miniussi wrote:
>>
>> As for the runtime bug (in broadcast_stl_test-2 for example). It start
>> failing when the broadcasted map count is loaded.
>> At line 45 of collections_save_impl.hpp:
>> ar << BOOST_SERIALIZATION_NVP(count);
>> gdb indicates count value == 2 (which is correct.
>>
>> I have no clue what should be in ar at that point (notsure to understand
>> the nvp thing, why not just send 2 ?) but I'm getting:
>> (gdb) p ar.buffer_
>> $66 = std::vector of length 12, capacity 12 = {0 '\000', 0 '\000', 0
>> '\000', 0 '\000', 2 '\002', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0
>> '\000', 0 '\000', 0 '\000'}
>> (gdb)
>>
>> but in map.hpp's load_map_collection
>> ar >> BOOST_SERIALIZATION_NVP(count);
>> count contains garbage (and a very big number too) hence an array
>> overflow.
>
> It appears that the positions are inconsistent, the buffer size is 12
> *after* writing the count and 16 *before* reading it.
Gt it wrong, it's 2 actually, which is also problematic,
>
>
>> Any idea ?
>>
>> Thanks
>>
>> ALain
>>
>> On 14/04/2015 16:49, Robert Ramey wrote:
>>> Alain Miniussi wrote
>>>> Hi,
>>>>
>>>> I suspect one problem is that the commit
>>>> https://github.com/boostorg/serialization/commit/5a94e5e4eb01cd8c941db725e5f89965a91740a9
>>>>
>>>>
>>>> was not taken into account in MPI.
>>>>
>>>> Not sure how the MPI should be adapted to that change yet. Some
>>>> parameters that were supposed to be there only to help overload
>>>> resolution have been removed (according to comments in pfto.hpp).
>>>>
>>>> I guess I need to remove some int arguments from the
>>>> (save|load)_override methods of boost::mpi::packed_(i|o)archive
>>>> classes ?
>>>
>>> You are correct. It's easy to see the changes. If you do a diff on
>>> some
>>> other archive like binary or text in the serialization library you'll
>>> see
>>> that the dummy parameter used to emulate partial function template
>>> overload
>>> has been eliminated. And of course eliminate the #include
>>> boost/serialization/ptfo.hpp . That's all that is necessary. This
>>> simplifies code at the cost of eliminating support of borland 5x and
>>> mdvc
>>> 7.0 and below which is no longer considered necessary. Since these
>>> headers
>>> are considered implementation features of the serialization library it
>>> didn't occur to me that making these changes would break anything else.
>>> Sorry about that.
>>>
>>> If you're interested in enhancing, or improving the MPI implementation
>>> as it
>>> regards serialization, you should let me know so I could acquaint
>>> myself
>>> with the MPI version and offer some suggestions. I've had some ideas
>>> in my
>>> head for years would simplify and expedite usage of the serialization
>>> library for object transmission over a stream but I've never spend any
>>> time
>>> on them as it didn't seem anyone had any interest.
>>>
>>> Robert Ramey
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://boost.2283326.n4.nabble.com/serialization-failing-MPI-build-tp4674375p4674449.html
>>>
>>>
>>> Sent from the Boost - Dev mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Unsubscribe & other changes:
>>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>>
>>
>>
>
>

-- 
---
Alain

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk