next up previous
Next: Synchronization and Checkpointing. Up: The Bayanihan BSP Methods Previous: Message-Passing.

Direct Remote Memory Access.

  Bayanihan BSP also provides the direct remote memory access (DRMA) methods bsp_put() and bsp_get(), which allow processes to write to and read from remote variables by specifying the owner's process ID and the String-type name of the desired variable.

The bsp_save() method registers a variable into the bspVars table. This allows it to be saved at a checkpoint, and to be read remotely using bsp_get(). A variable remains registered until it is removed with bsp_unregister(), and its contents can be modified freely by its owner using accessor methods. If the object itself is replaced, however, then bsp_save() must be called again to update the reference stored in bspVars. A variable can also be registered by processes other than its owner by using the bsp_put() method. This technique can be used by main work objects to initialize worker variables.

The bsp_restore() method restores the value of a variable so it can be used within a superstep. Variables that are used in all or most supersteps can be restored in the initVars() method, which is always called before bsp_run(). This guarantees that the variables are always restored and available at the beginning of a superstep. If an attempt is made to restore an unregistered name, bsp_restore() returns null. Typically, variables restored with bsp_restore() are declared as transient fields since their values are already stored in bspVars and do not need to be serialized independently.

Like the message-passing methods, the DRMA methods do not take effect until the next superstep. Thus, for example, a bsp_get() called during a superstep will only update the destination variable in the next superstep. The value received by bsp_get() is the value of the source variable at the end of the local computation phase, before any puts or gets are done. Similarly, the value sent by bsp_put() is the value of the data object at the end of the local computation phase. This may be different from the value of the data object at the time bsp_put() was called, unless the data is first cloned before bsp_put() is called.


next up previous
Next: Synchronization and Checkpointing. Up: The Bayanihan BSP Methods Previous: Message-Passing.
Luis Sarmenta
1/19/1999