TITLE>New Calls for Lanai Active Messages

New Calls for Lanai Active Messages

There are a number of called added from the GAM spec:

void am_request_5(int dest, void (*fun)(), int arg0, int arg1, 
		  int arg2, int arg3, int arg4)
This is just like am_request_4, but sends five words as arguements.

void am_sleep() 
This call blocks the calling thread until a messages arrives. The thread must still pull messages out with am_poll() however. This call was added for servers like Network RAM and xFS daemons. You must have the modified drivers included in the release for this to work.

void am_reply_xfer(int dest, void *lva, void *rva, int nbytes,
		 void (*fun)(), void *arg0)
This call can only be invoked inside of a request handler. It "stores back" a block of data from lva on the calling node of length nbytes to a remote node starting at remote address rva. It will move up to am_max_size() bytes. Once the transfer is completed, The function pointed to by fun is invoked on the remote node with a single arguement arg0.
int lam_sync_all()
This call "bootstraps" the system. That is, it will send messages to make sure all nodes in the group are running before returning. It will try for 5 seconds to make sure all nodes are running. This called must be called exactly once after am_enable(), and acts a barrier(). If a program is started and fails to call lam_sync_all(), the node must be started in order, i.e. node zero must be started, then node 1, etc. Unpredictable results can happen if lam_sync_all() is not called otherwise. (e.g. messages getting lost).

This function return 1 on sucess (all nodes joined the group) or -1 on failure (Some nodes were missing).