Lightweight Parallel Foundations 1.0.1-alpha 2023-06-26T11:02:34Z
A high performance and model-compliant communication layer
Collaboration diagram for I/O in the SPMD Framework:

BSPlib's SPMD framework sets specific rules on I/O. It is guaranteed to always work on process 0. Other processes can only write to standard output and standard error. This output is multiplexed in a non-deterministic fashion.

#include <bsp.h>
int main(int argc, char ** argv)
{
int pid, number;
pid = bsp_pid();
if ( 0 == pid )
{
printf("Hi, type a number:\n");
scanf("%d", & number);
}
if ( 0 == pid )
{
printf("Hi, I am root and I have your number %d\n", number);
}
else
{
printf( "Hi, I from process %d\n", pid );
}
return 0;
}
int bsp_nprocs(void)
int bsp_pid(void)
void bsp_sync(void)
void bsp_begin(int maxprocs)
void bsp_end(void)