Lecture 09
                              10/11/1994

                        An Introduction to CMMD

The CMMD library allows programmers to program in SPMD mode on the
connection machine. Programs using the CMMD library may be written in
any number of programming languages, including C, C++, C*, g++,
Fortran77, and CM Fortran.

The best way to start learning about the CMMD is by looking at 
example programs. These are available on the conx system under the
/usr/examples/cmmd/c directory. For example, the following is a very
simple program that prints "Hello World" from each node on the CM-5. 


#include 
#include 

main(argc, argv)
     int argc;
     char *argv[];
{
  CMMD_fset_io_mode(stdout, CMMD_independent);
  fprintf(stdout, "Hello World\n");
  exit(0);
}


For information on how to compile programs including CMMD code,
consult the Makefiles for the examples provided. For example the
following is the Makefile for the above "Hello World" program.



.KEEP_STATE:

TARGET          = hello
SRCS            = hello.c
OBJS            = $(SRCS:%.c=%.o)
INCDIRS         = 
NODELIBS        = 
LIBDIRS         = 

CC              = cc

CFLAGS          = -O2

%.o:    %.c
        $(CC) $(CFLAGS) $(INCDIRS:%=-I%) -c $<

%.o:    %.f
        $(FC) $(FFLAGS) $(INCDIRS:%=-I%) -c $<

%.o:    %.cc
        $(C++) $(CCFLAGS) $(INCDIRS:%=-I%) -c $<

$(TARGET):      $(OBJS)
        /usr/bin/cmmd-ld   \
        -comp $(CC) $(OBJS) -v -o $(TARGET)  \
        $(LIBDIRS:%=-L%) $(NODELIBS:%=-l%)

clean:
        rm -f $(TARGET) $(OBJS) *~ .make.state .nse_depinfo



Notice the need to use a special loader "cmmd-ld" for programs that
use the CMMD library.

For more information on CMMD functionality, you may want to check the
CMMD documentation available on-line under /usr/doc/cmmd*

The following are examples of manual pages for CMMD functions. You can
get these by typing "man CMMD_" at the Unix prompt.


This document has been prepared by Professor Azer Bestavros <best@cs.bu.edu> as the WWW Home Page for CS-551, which is part of the NSF-funded undergraduate curriculum on parallel computing at BU.

Date of last update: September 29, 1994.