next up previous
Next: Message-Passing. Up: Writing BSP programs in Previous: Writing BSP programs in

The Bayanihan BSP Methods

  The BSPWork class provides several methods which subclasses inherit and can call within bsp_run() in the same way one would call library functions in C. These are based on BSPLib [5], a programming library for C and Fortran currently being used in most BSP applications, but have been modified to account for language and style differences between Java and C. These methods are shown in Table 1, subdivided by function into the following categories (in order): inquiry, message passing, direct remote memory access, and synchronization.

  
Table 1: Basic Bayanihan BSP methods
method    meaning  
int bsp_pid()    my BSP process identifier  
int bsp_nprocs()    number of virtual processes  
double bsp_time()    local time in seconds  
void bsp_send(BSPMessage msg)    send prepared message  
void bsp_send(int dest,int tag,    create tagged message,  
Object data)    and send to dest  
BSPMessage bsp_recv()    receive message  
int bsp_qsize()    number of incoming messages  
BSPMessage bsp_peek()    preview next message  
int bsp_peekTag()    preview next message tag  
void bsp_save(String name,Object data)    save data under name  
Object bsp_restore(String name)    restore data under name  
Object bsp_unregister(String name)    remove data under name  
void bsp_put(int dest,String destName,    write data to destName  
Object data)    variable of dest  
Object bsp_get(int src,String srcName,    read srcName variable  
String destName )    of src to local destName  
boolean bsp_sync()    sync; possibly checkpoint and migrate  
boolean bsp_step()    mark beginning of superstep  
boolean bsp_cont()    mark continuation of superstep  




 
next up previous
Next: Message-Passing. Up: Writing BSP programs in Previous: Writing BSP programs in
Luis Sarmenta
1/19/1999