SALSA provides a great support for parallel and distributed programming. Its support for code and data mobility and asynchronous message passing makes programming for distributed systems a natural task. Its coordination model provides an attractive feature for parallel programming where multiple CPUs need to coordinate and communicate between themselves in an efficient manner. SALSA depends on Java, hence it inherits Java’s powerful feature of portability across different platforms. All of this makes SALSA an attractive language for both distributed and parallel programming.
This application approximates the integral of a function over an interval [a, b] by using the trapezoidal approximation. The application solves this approximation through parallelism by dividing the approximation into several intervals. Different worker actors are started and migrated to different theaters. They all compute the integral approximation in parallel and send their results to bootstrapping actor. This latter collects the results from all the worker actors, adds them up, and displays the final result to the end user. The application consists of two behaviors: the Trap behavior, which implements the bootstrapping actor and the TrapWorker behavior, which implements the worker actors.
- Edit the theater config file. The default file is theatersFile.txt. Add host name with port number to that file.
- Start theaters at each host specifying in theatersFile.txt
- Execute demo.Trap:
java demo.Trap <left point> <right point> <# of trapezoids> <# of actors> <nameserver> <theater file>
- Download Trap.salsa
- Download TrapWorker.salsa
- Download theatersFile.txt
return to the salsa home page