Parallel Programming Guide for HP-UX Systems

Introduction to parallel environments
Overview
Chapter 1 3
Overview
Using one of the HP language compilers—Fortran, C/C++, or UPC (Unified Parallel C)—
parallel software programs are designed, created, and modified.
Non-parallel components
Serial optimizations of the non-parallel components of a program are performed with the use
of Fortran, C/C++, or UPC compiler switches. Additional optimization can occur with the use
of HP MLIB.
Parallel components
The parallel components of the program are implemented by multi-threading and/or message
passing techniques.
UPC
UPC provides a simple shared memory model for parallel programming, allowing data to be
shared or distributed among a number of communicating processors. This model allows easier
coding of parallel applications and maximum performance across shared memory, distributed
memory, and hybrid systems.
Fortran and C/C++
HP Fortran and C/C++ compilers support the shared memory OpenMP construct for creating
multi-threads. Additionally, HP provides a message passing library—HP MPI—which runs on
all HP platforms. Using these techniques, you can create program concurrency where
different parts of the program run in parallel, thereby minimizing execution time.
Debugging
During compilation, the program may encounter errors and require debugging. Errors can be
located using the HP WDB debugger or the Etnus TotalView debugger. Both tools are
designed to work with the various compilers used to build the program.