Serialize Deterministic

thelovegoose
Posts: 7
Joined: Tue Nov 16, 2010 9:14 pm

Serialize Deterministic

Post by thelovegoose »

Should the output of:

Code: Select all

btDefaultSerializer*	serializer = new btDefaultSerializer(maxSerializeBufferSize);
m_dynamicsWorld->serialize(serializer);

FILE* f2 = fopen("testFile.bullet","ab");
fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1,f2);
fclose(f2);
be consistently 'ordered' across processors when using same compiler & operating system?

So I don't care at this stage whether the values of the variables that are being serialized are consistent - just whether the variables will be serialized in exactly the same order.

My goal is to dump out the state of a simple test, and to test the consistency of the values across different processors - however I can't easily test this without getting a consistent order of output.

If the serializer sometimes outputs

value1 = 5
value2 = 10

and sometimes outputs

value2 = 10
value1 = 5

its much more difficult for me to automatically compare results!

Cheers,

Pete