beautypg.com

1 parallel application build environment, 1 modulefiles, 2 hp-mpi – HP XC System 3.x Software User Manual

Page 40: 3 openmp, 4 pthreads

background image

For further information about developing parallel applications in the HP XC environment, see the following:

“Launching Jobs with the srun Command” (page 79)

“Debugging Parallel Applications” (page 57)

Chapter

“Advanced Topics” (page 103)

4.7.1 Parallel Application Build Environment

This section discusses the

parallel application

build environment on an HP XC system.

The HP XC parallel application environment allows parallel application processes to be started and stopped
together on a large number of application cores, along with the I/O and process control structures to
manage these kinds of applications.

The HP XC system software uses the HP-MPI distributed memory programming model for building and
running parallel applications. In addition to using HP-MPI for parallel application development, OpenMP
and Pthreads can be used in conjunction with HP-MPI or separately under the HP XC system software.
The section discusses these development tools as they relate to the HP XC system.

4.7.1.1 Modulefiles

The basics of your working environment are set up automatically by your system administrator during
the installation of HP XC. However, your application development environment can be modified by means
of modulefiles, as described in

“Overview of Modules”

.

There are modulefiles available that you can load yourself to further tailor your environment to your
specific application development requirements. For example, the TotalView module is available for
debugging applications.

“Overview of Modules”

provides instructions on how to list what modulefiles

are available for you to load, and how load a modulefile.

If you encounter problems accessing tools or commands (and associated manpages), ensure that required
modules are loaded on your system. If necessary, load required modules yourself, as described in

“Overview

of Modules”

. Otherwise, contact your system administrator.

4.7.1.2 HP-MPI

With the HP XC system software, you can use the HP-

MPI

distributed memory programming model for

building and running parallel applications. In this model, all data is private to each process. All intercore
communication within a parallel application is performed through calls to the HP-MPI message passing
library. Even though support for applications that use a shared-memory programming model is not
available at this time, individual cores within an application node can be used in the same application as
separate HP-MPI tasks. Applications that are based on MPI, and currently run on Linux (or Linux
compatible) systems, can be easily migrated to an HP XC

cluster

.

See the HP-MPI documentation for more information.

4.7.1.3 OpenMP

The OpenMP specification is a set of compiler directives that can be used to specify shared-memory
parallelism in Fortran and C/C++ programs. Both Intel and Portland Group Fortran and C/C++ compilers
support OpenMP.

Although OpenMP is designed for use on shared-memory architectures, OpenMP can be used on an HP
XC system within a node.

OpenMP can be used alone, or in conjunction with HP-MPI. For information about compiling programs
using OpenMP, see the OpenMP documentation.

4.7.1.4 Pthreads

POSIX Threads (Pthreads) is a standard library that programmers can use to develop portable threaded
applications. Pthreads can be used in conjunction with HP-MPI on the HP XC system. Compilers from
GNU, Intel and PGI provide a -pthread switch to allow compilation with the Pthread library.

Packages that link against Pthreads, such as MKL, require that the application is linked using the -pthread
option. The Pthread option is invoked with the following compiler-specific switches:
GNU

-pthread

40

Developing Applications