Previous: , Up: Touching memory   [Contents][Index]


Priming message buffers

Priming message buffers

Data touching, describes how a message sent or received WITH DATA TOUCHING will have all of its data touched before or after transmission. Sometimes, however, a program may want to touch message data without actually transmitting a message. For example, a task could touch message data to load it into the cache, then RESET ITS COUNTERS (see Resetting counters), and finally send or receive a message without further data touching. The TOUCHES statement has an alternate form that touches message buffers instead of isolated memory regions:

<touch_buffer_stmt> ::= <source_task>
TOUCHES
     ALL MESSAGE BUFFERS
  | MESSAGE BUFFER <expr>
  | THE CURRENT MESSAGE BUFFER

The first form, ‘ALL MESSAGE BUFFERS’, touches all message buffers available to the program, even those not yet used at the time TOUCHES is invoked. In the following statement, for example, TOUCHES “knows” that 10 message buffers will be used and touches the data in all 10 of them:

ALL TASKS TOUCH ALL MESSAGE BUFFERS THEN
FOR EACH SZ IN {0, ..., 9}
  TASK 0 ASYNCHRONOUSLY SENDS AN SZ MEGABYTE MESSAGE TO TASK 1 THEN
ALL TASKS AWAIT COMPLETION

(Buffer control, explains why the preceding statement requires 10 buffers.) One caveat is that in coNCePTuaL version 1.5.1, messages sent or received with the UNIQUE keyword (see Unique messages) are not touched. This limitation may be lifted in a later release of coNCePTuaL.

The second form of the <touch_buffer_stmt> statement, ‘MESSAGE BUFFER <expr>’, touches a specific message buffer. It is expected to be used in programs that send ‘FROM BUFFER <expr>’ or receive ‘INTO BUFFER <expr>’.

THE CURRENT MESSAGE BUFFER’, the third and final form of the <touch_buffer_stmt> statement, touches the first message buffer that is not currently in use (i.e., is not the source or destination of an asynchronous operation). Usually, this is whichever message buffer will next be sent from or received into. (The exception is when a task AWAITS COMPLETION after touching the current message buffer but before sending or receiving a message—probably a somewhat contrived situation.)


Previous: , Up: Touching memory   [Contents][Index]

Scott Pakin, pakin@lanl.gov