Next: Using the Concert Up: The Concert Tutorial Previous: Before You Start

Getting Started with Concert

This section will describe how to install and set up the Concert System, and take you through a simple example demonstrating the use of the Concert System and some simple Concurrent Aggregates (CA) constructs.

Up and Running

Once you have obtained the Concert System, you need only do four things to start using it.

  1. Set your CONCERT_ROOT_PATHenvironment variable to the directory where Concert directory structure is located.
  2. Add $CONCERT_ROOT_PATH/bin to your path.
  3. Configure Emacs to run the Concert system interface. This is done by adding the following line to your .emacs file

    
    (load (getenv "CONCERT_ROOT_PATH") "/lib/concert.el")

  4. Finally, you must now force your shell to re-read its initialization file (.cshrc for csh and .profile for ksh) to pick up CONCERT_ROOT_PATHand your new path, and start an Emacs session.

After you have done these things, the Concert System is ready to go.

``Hello World''

In the Emacs session you just started, load the example CA program file hello-world-example.ca from the $CONCERT_ROOT_PATH/examples/small directory, and make sure the buffer is in Lisp-Mode. The buffer should look like Figure 1

This is the canonical hello world program, about the simplest program that can be written in any language. The first line of code sends the HELLO_WORLDmessage to the (global console) object, which will print it to the screen. In general, the (global console) object will print any message it receives, except for special ones to be introduced later. The second line sends a reply message with the argument DONE. Reply is a special message that returns a value to whomever called the replying method. These replies are used both as return values and for synchronization since a message send typically waits to receive a reply. They are very important and leaving them off is a common error.

My First Concert Session

The easiest way to run Concert programs is using the Concert Emulator. To start the Emulator from Emacs, you must be in a buffer containing a Concert program, and the buffer must be in Lisp mode. Simply type M-c, and line shown in Figure 2 will appear in the minibuffer. add `` -e'' to the command, press return.

This will start the Concert Emulator. Emacs will open a new buffer, in which the Concert Emulator will appear, possibly after long delay. You will see a banner for the Concert Compiler, and then the emulator will print a large number of Defining... messages. Finally, a concert> prompt will appear. The emulator will read the hello world program, and print some status messages; the result is shown in Figure 3

Now the program is loaded into the emulator, it is ready to run. To run a program in the Concert Emulator, simply type go. The emulator will print some more status messages, and then execute the program, printing the HELLO_WORLDmessage. It will also print the DONE message from the reply statement. The emulator always prints the final reply from the program. It will also print some statistics noting how long execution took, and how many page faults it had and how much memory it used. This is shown if Figure 4. These numbers will all be pretty large; try running the program again and see if they go down.

Now you have loaded and run a simple Concert program; the last thing to do is to quit the emulator. This is accomplished by typing quit. If you run the emulator again, you will notice that when you type M-c, the prompt will be ``concert -e'' rather than ``concert'' like before; Emacs remembers what you choose last time, and uses this as the default prompt.



Next: Using the Concert Up: The Concert Tutorial


Julian Dolby
Vijay Karamcheti
John Plevyak
Xingbin Zhang
Concurrent Systems Architecture Group