CARC web archive · Archived copy of ahpcc.unm.edu/Workshop/System-subroutine/chameleon/chameleon.html as captured by the Internet Archive on 4 June 2000. Links to pages that were not saved here go to the Wayback Machine. Wayback copy · All pages in this snapshot · Web archive index

AHPCC Logo

An Introduction to Chameleon


Origination of Chameleon


Chameleon Concept

Second Generation Parallel Programming System


Goals of Chameleon

  1. Be very lightweight (low overhead)
  2. Be highly portable
  3. Help standardize program startup and the use of emerging message passing operations such as collective operations on subsets of processors


Current Compatibility of Chameleon


Reverse Compatibility

Figure to be inserted later


How does Chameleon Change its Colors?

Based on macros, the Makefile

  1. Sets architecture specific variables
    Sets flags for production, debugging, or profiling libraries
    Sets libraries and include files for target communication package
  2. Preprocesses or translates Chameleon functions to target parallel programming system
  3. Compiles code
  4. Links in Chameleon specific control functions and
  5. Links in target parallel programming system library


A Simple Example

This example uses the Makefile and ring2.c program

/* This is a simple ring program */

#include "tools.h"

#include "comm/comm.h"

int worker(argc, argv)

int argc;

char ** argv;

{

int buf, size = sizeof(int);

if (PImytid ==0) {

buf = 1;

PIbsend( 1, &buf, siz, PSNbrRing( 1, 1, PSAllProcs),MSG_INT);

PIbrecv( 1, &buf, siz, MSG_INT);

}

else{

PIbrecv( 1, &buf, siz, MSG_INT);

PIbsend( 1, &buf, siz, PSNbrRing( 1, 1, PSAllProcs), MSG_INT);

}

return 0;

}

Makefile

 

#All

#Run examples

ALL: sgi_build rs6000_build

 

ITOOLSDIR = /usr/local/chameleon-1.2

 

ARCH = rs6000

#COMM = pvm3

COMM = p4

#BOPT = Opg

#BOPT = O

BOPT = g

CFLAGS = -I$(ITOOLSDIR) $(OPT) $(COPT)

FFLAGS = -I$(ITOOLSDIR)

LDIR = $(ITOOLSDIR)/libs/libs$(BOPT)/$(ARCH)

LIBS = -L$(LDIR) -lpecomm$(COMM) -lpetsc -lpecore -lpecomm$(COMM)

FLIBS = -L$(LDIR) -lpetscfort$(COMM)

FMAIN = $(LDIR)/fmain$(COMM).o

CMAIN = $(LDIR)/cmain$(COMM).o

LXLIBS = -L$(LDIR) -lpetscgrf$(COMM) -lpetscgrf

WORK_DIR = chameleon

LIBNAME = dummy

programs: $(ARCH)/ring2

 

#There are four include file in the standard Makefile. It is informative to

#look at samples of what these files include:

include $(ITOOLSDIR)/bmake/$(ARCH).$(BOPT)

include $(ITOOLSDIR)/bmake/$(ARCH)

include $(ITOOLSDIR)/bmake/$(ARCH).$(COMM)

include $(ITOOLSDIR)/bmake/$(ARCH).x11

rs6000_build:

rsh acoma "cd chameleon; make -e ARCH=rs6000 programs "

sgi_build:

rsh cochiti "cd chameleon; make -e ARCH=IRIX programs"

hp_build:

rsh isleta "cd chameleon; make -e ARCH=hp programs"

ring2.i: ring2.c

$(CC) -E $(CFLAGS) $(BASEOPT) ring2.c |cb -s -l 70 >ring2.i

$(ARCH)/ring2: $(ARCH)/ring2.o

$(CLINKER) -o $(ARCH)/ring2 $(CFLAGS) $(BASEOPT) $(CMAIN) \

$(ARCH)/ring2.o $(LIBS) $(CLIB) $(SLIB) -lm

$(ARCH)/ring2.o: ring2.c

cd $(ARCH); $(CC) -c $(CFLAGS) $(BASEOPT) ../ring2.c

clean:

$(RM) -f ring2.i

$(RM) -f rs6000/*

$(RM) -f IRIX/*

$(RM) -f sun/*

$(RM) -f hp/*


To See How Chameleon Translates the Program


Another Simple Example


More Examples


Additional Exercises


Copyright 1997 High Performance Computing Education and Research Center
November 1997, editor@arc.unm.edu