edu.rit.mp

Package edu.rit.mp

Package edu.rit.mp contains the Message Protocol (MP),a transport layer protocolfor sending messages using TCP.

See: Description

Package edu.rit.mp Description

Package edu.rit.mp contains the Message Protocol (MP),a transport layer protocolfor sending messages using TCP.MP is intendedfor use in message passing parallel programmingon cluster parallel computers.

Operation

A source process sends a messageto a destination processthrough a channel.Each message includes a tag;this is just an integer that the source can useto convey metadata to the destination.Each message also includes a given number of items.Each item in a message is of a given type(the same type for all items in the message).The supported types are given in the table below.The table shows the Java type used to store the item in memory,the number of bytes used to represent the item in a message,and the range of values that can be represented.

For information on how to create channelsand send and receive messages,see class ChannelGroup.

TypeStored As# of BytesRange
Booleanboolean1truefalse
Bytebyte1-128 .. 127
Shortshort2-32768 .. 32767
Integerint4-2147483648 .. 2147483647
Signed 8-bit integerint1-128 .. 127
Unsigned 8-bit integerint10 .. 255
Signed 16-bit integerint2-32768 .. 32767
Unsigned 16-bit integerint20 .. 65535
Longlong8-9223372036854775808 .. 9223372036854775807
Characterchar2'\u0000' .. '\uFFFF'
Floatfloat4Same as float
Doubledouble8Same as double
ObjectObjectVaries 

Message Format

A message consists of the following sequence of bytes:

  • A magic number, 30144596(an integer, four bytes, MSB first).
     
  • The tag (an integer, four bytes, MSB first).
     
  • The type of item (one byte).
     
  • The number of items N (an integer, four bytes, MSB first).
     
  • The item values,each item represented with the number of bytesgiven in the above table.For type = Object,the item values are representedas a sequence of bytesconsisting of N objectsserialized using Java Object Serialization.

SCaVis 2.1 © jWork.ORG