if (context.isRecordMessageSizes())
serializationOverhead = System.currentTimeMillis();
}
// Use the thread local serialization context to serialize the response.
MessageSerializer serializer = serializationContext.newMessageSerializer();
serializer.initialize(serializationContext, outBuffer, debugTrace);
serializer.writeMessage(respMesg);
// Keep track of serializes bytes for performance metrics.
context.setSerializedBytes(outBuffer.size());
// Serialize message again after adding info if mpio with sizing is enabled.
if (context.isRecordMessageSizes())
{
try
{
context.getMPIO().messageSize = outBuffer.size();
// Reset server send time.
if (context.isRecordMessageTimes())
{
serializationOverhead = System.currentTimeMillis() - serializationOverhead;
context.getMPIO().addToOverhead(serializationOverhead);
context.getMPIO().sendTime = System.currentTimeMillis();
}
// Reserialize the message now that info has been added.
outBuffer = new ByteArrayOutputStream();
respMesg = context.getResponseMessage();
serializer = serializationContext.newMessageSerializer();
serializer.initialize(serializationContext, outBuffer, debugTrace);
serializer.writeMessage(respMesg);
}
catch(Exception e)
{
if (Log.isDebug())
logger.debug("MPI set up error: " + e.toString());