Introduction: What is Distributed BACI?
BACI stands for the Ben-Ari Concurrent Interpreter. The distributed Ben-Ari Concurrent Interpreter (distributed BACI) extends the existing Ben-Ari Concurrent Interpreter interface to allow for distributed algorithm development. Visit the BACI home page for a discussion of the basics of BACI. This page adds the relevant distributed BACI details. Specifically, distributed BACI adds to BACI the ability to send, receive, and broadcast messages between any number of distributed "hosts," or distributed BACI programs. This ability allows the user to develop distributed algorithms easily, without having to worry about the underlying network calls. Such a simple method of implementation allows the user to easily:
C-- Compiler Syntax
BACI programs have either a ".cm" (C-- syntax) or ".pm" (Pascal syntax) extension. BACI's C-- compiler constructs are a subset of C++ compiler constructs. In other words, C-- follows C/C++ syntax. (See the BACI C-- Compiler Syntax for details.) Distrbuted BACI adds three commands to the BACI C-- syntax: send, receive, and broadcast.
The send command has the format:
send(message, destination);
where message is the string or integer that is sent, and destination is a number associated with the destination host.The broadcast command has the format
broadcast(message);
where message is the string or integer that is sent to all of the other hosts. In a broadcast, a copy of the message is sent to all hosts in the distributed system; thus, there is no need to specify a destination host.The receive command has two formats:
int receive(message); or int receive(message, sender);
where message is a string or integer value, sender is the number associated with the host that sent the message, and the return value is either STRING_MSG or INT_MSG. In a receive statement, the message parameter is always received as a string. If the return value is STRING_MSG, then the user is able to immediately use the message as a string. However, if the return value is INT_MSG, then a typecast ( int(message) ) must be used in order to convert the message to its corresponding integer value. The user does not have to check for STRING_MSG or INT_MSG if he/she already knows the type of the message received. The two receive commands are identical in purpose, except that the second allows the user to learn which host sent the message.Using Distributed BACI
A distributed BACI source file must have a .cm suffix. To execute a program in distributed BACI, there are four steps:
| firstHost.firstDomain.com | 1250 |
| secondHost.firstDomain.com | 1251 |
| thirdHost.secondDomain.com | 1250 |
The numbers associated with hosts in distributed BACI begin with 0, so the hosts defined above are host[0] (firstHost.firstDomain.com, port 1250), host[1] (secondHost.firstDomain.com, port 1251), and host[2] (thirdHost.secondDomain.com). If a user wants to send the message "Hello" to host[0], the following syntax is valid: send ("Hello world", 0);
Obtain a Copy of Distributed BACI
The distributed BACI system has been developed in the Linux environment.
We are in the process of porting distributed BACI to other Unix environments;
we will add them to this list as we have success. If you use a different
hardware platform, and if you can give us access to your hardware, we will try
to install the distributed BACI system for your machine type. We can be reached
at "bynum AT cs DOT wm DOT edu"
or "tcamp AT mines DOT edu".