TTL_PAPERS Library

H. Dietz, T. Mattox, et al.
School of Electrical and Computer Engineering, Purdue University

The TTL_PAPERS (TTL implementation of Purdue's Adapter for Parallel Execution and Rapid Synchronization) Library is designed to provide very low latency barrier synchronization and aggregate communication operations to C++ or C programs compiled using the Gnu compilers. Fortran programs can use the library via f2c, as Pascal programs can using p2c. In addition to these basic functions, coherent shared memory access is now also supported for C++ code.

In addition to being usable with any (even heterogeneous) collection of machines supported by GCC and connected by TTL_PAPERS, this library also can be compiled to simulate the TTL_PAPERS functionality. This I/O port-level simulator is called TTL_VAPERS (the TTL_PAPERS-compatible Virtual Adapter for Parallel Execution and Rapid Synchronization). TTL_VAPERS actually consists of two parts: the simulation engine and the graphical debugging interface. The simulation engine is literally linked into the user program, using UNIX pipes to communicate among processes for each of the simulated machines and the simulated TTL_PAPERS unit. The graphical debugging interface, xvapers, is built with TCL/TK and is actually independent from the user program; it simply examines and modifies the status of the simulated TTL_PAPERS unit. In summary, xvapers provides both graphical and textual status displays, a variety of execution controls including barrier single-step, interactive debugging of individual processes, etc.

Of course, just as TTL_PAPERS can be used with four, eight, or more machines, there are TTL_VAPERS versions supporting various sizes for the simulated cluster. The remainder of this handout briefly summarizes the user interface structure of the library.

Data Types

GCC DeclarationTypeSuffix
int (used as boolean)uint11u
charint88
unsigned charuint88u
shortint1616
unsigned shortuint1616u
intint3232
unsigned intuint3232u
long longint6464
unsigned long longuint6464u
floatf32f
doublef64d
barrierb

Include Files

paperslib.hHeader for all PAPERS library routines
intern.hHeader for inlined primitives
stypes.hHeader for C++ shared memory classes

Control

p_init()Initialize and check-in with PAPERS
p_exit()Check-out with PAPERS
s_init()Enable shared memory system
s_exit()Disable shared memory system

Functions with a p_ prefix cannot be used while the shared memory system is active

Constants

NPROCNumber of PEs
IPROCPE number, 0..NPROC-1
CPROCPE number of console/control PE

Primitives

p_enqueue(m)Enqueue the barrier mask m
p_wait()Barrier synchronize with current mask
s_wait()Barrier synchronize with current mask
p_waitvec(f)Return bit vector assembled from f of each active processor
p_any(f)Did any enabled processor have f true?
p_all(f)Did all enabled processors have f true?

Communications

p_gathertype(p, d)Gather an array p[i] = d from PE i
p_putgettype(d, s)Put d, get (return) d from PE s
p_bcastPutitype(d)Broadcast put d from this PE
p_bcastGetitype()Broadcast get value from sending PE

Reductions

p_reduceAnditype(d)Return the bitwise AND of d from each PE
p_reduceOritype(d)Return the bitwise OR of d from each PE
p_reduceAddtype(d)Return the sum of d from each PE
p_reduceMultype(d)Return the product of d from each PE
p_reduceMintype(d)Return the minimum of d from each PE
p_reduceMaxtype(d)Return the maximum of d from each PE

Scans

p_scanAnditype(d)Return the bitwise AND of d up to this PE
p_scanOritype(d)Return the bitwise OR of d up to this PE
p_scanAddtype(d)Return the sum of d up to this PE
p_scanMultype(d)Return the product of d up to this PE
p_scanMintype(d)Return the minimum of d up to this PE
p_scanMaxtype(d)Return the maximum of d up to this PE
p_ranktype(d)Return the rank of d for each PE, such that the smallest value has rank 0

Group Properties

p_population()Return the total number of active PEs
p_enumerate()Return a consecutive number for each active PE
p_selectFirst()Return the lowest active PE number
p_selectOne()Return any active PE's number

Voting

p_voteCount(v)Return number of PEs that voted for us
p_vote(v)Return vote bit mask
p_matchCounttype(v)Return number of PEs that voted as we did
p_matchtype(v)Return match bit mask

Full information, and source code, is public domain and available from http://garage.ecn.purdue.edu/~papers

Alternatively, contact Prof. Hank Dietz, School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN, 47907-1285, phone: (317) 494 3357, fax: (317) 494 3371, email: hankd@ecn.purdue.edu