Next: , Previous: , Up: Message specifications   [Contents][Index]


Message alignment

Message alignment

Messages are normally allocated with arbitrary alignment in memory. However, coNCePTuaL can force a specific alignment relative to the operating-system page size (commonly 4KB or 8KB, but significantly larger sizes are gaining popularity). A <message_alignment> is represented as follows:

<message_alignment> ::= <data_type>
| <expr> <data_multiplier>

64 BYTE’, ‘3 MEGABYTE’, and ‘QUADWORD’ are therefore all valid examples of <message_alignment>s. Bit counts are rounded up to the nearest byte count, so ‘27 BITS’ is in fact equivalent to ‘4 BYTES’.

The ALIGNED keyword forces coNCePTuaL to align messages on exactly the specified alignment. Hence, a ‘HALFWORD ALIGNED’ message can begin at memory locations 0, 2, 4, 6, 8, …, 2k (where k is a positive integer). In contrast, the MISALIGNED keyword forces coNCePTuaL to align messages the given number of bytes (positive or negative) past a page boundary. For example, if pages are 8192 bytes in size then a message described as ‘HALFWORD MISALIGNED’ can begin at memory locations 2, 8194, 16386, 24578, …, 8192k+2 (where k is a positive integer). Unlike ALIGNED, MISALIGNED supports negative alignments. If the page size is 4096 bytes, then ‘-10 BYTE MISALIGNED’ enables a message to begin at memory locations 4086, 8182, 12278, etc. The MISALIGNED alignment is taken modulo the page size. Therefore, with a 4096-byte page size, ‘10000 BYTE MISALIGNED’ is the same as ‘1808 BYTE MISALIGNED’.

The UNALIGNED keyword explicitly specifies the default behavior, with messages aligned on arbitrary boundaries.


Next: , Previous: , Up: Message specifications   [Contents][Index]

Scott Pakin, pakin@lanl.gov