Level: Intermediate Matt Davis (mattdavis@us.ibm.com), Linux Power Technical Consultant, IBM
30 Mar 2004 Recognized as a high-performance, reliable, and serviceable enterprise platform, the 64-bit POWER™ architecture offers new choices to UNIX and Linux application developers. Anyone with a background in either AIX or Linux on other platforms can benefit from the strength of the open source community combined with the POWER of world-class IBM hardware.
With offerings from affordable two-way servers to vertically scaled super
computers to the cutting-edge JS20 BladeCenter™, POWER-based machines run the gamut
of size and scale, always exceeding the expectations placed on enterprise-class
hardware. The opportunity to run Linux or AIX, along with innovative
configurations such as Dynamic Logical Partitioning, provides a unique
platform for development and deployment of applications that feed on the
POWER architecture's performance. This article will arm you with the tools
and knowledge you need to make the most of your code and the POWER
platform.
Linux distributions
An often cited strength of the Linux community is choice. Linux on POWER
is provided by the two premier enterprise Linux vendors, Red Hat
Linux and SUSE Linux. Each with their respective philosophies and fortes,
these Linux distributions provide the full toolchains, libraries, and
development tools Linux developers have come to expect. Each is reviewed
in this article.
Note that TurboLinux is also supported. TurboLinux Enterprise Server8 uses licensed code from SUSE Linux, so in the following discussion, those features that apply to SUSE apply to TurboLinux as well.
Red Hat Enterprise Linux 3 (RHEL3)
Red Hat is well established as a leader and pioneer in the open
source community. The arrival of Red Hat Linux in enterprise form to the POWER
architecture in 2003 brought with it cutting-edge Linux technology.
The kernel
RHEL3 provides a 2.4.21 Linux kernel optimized for the POWER
architecture. Even before Linux 2.6 was released, Red Hat backported
several 2.6 features into their Linux 2.4 kernel.
Among these, the Native Posix Threads for Linux (NPTL) library stands out.
The previous threading model, Linux Threads, is a traditional 1:1
threading model that works in conjunction with the Linux 2.4 scheduler,
and has been a target for renovation for some time. In RHEL3, Red Hat
backported the new threading model from the 2.5 development trees into
its 2.4 kernel. The result is better scalability, faster
multithreading, and most obviously, radically improved Java performance.
NPTL is still a 1:1 model, as opposed to the m:n threading found in some
commercial UNIX operating systems, but no one questions the performance
now. Capable of generating and destroying 100,000 threads in under two
seconds on an antiquated 450 Mhz Intel processor, the new threading model
can supply the performance expected of enterprise class Linux and more.
Java applications often show an eightfold improvement over execution on the older Linux Threads model.
The incorporation of cutting-edge development did not stop at the kernel
threading model. RHEL3 also includes a new and improved glibc, version
2.3.1. Required for the performance granted by NPTL threading, glibc
2.3.1 also brings more efficient libraries for Linux applications.
SUSE SLES8
SUSE SLES8, the senior of the two enterprise Linux offerings for POWER,
is near the end of its lifecycle. Featuring a regularly updated 2.4
kernel (SUSE has released three service packs to SLES8 users to ensure that system
security and performance updates are available), SLES8 provides options of
all sorts. Three journaling file systems are available to choose from.
All common database, Web server, and mail server applications are
available on the SLES8 distribution by default, along with up-to-date
releases of both the KDE and Gnome desktop environments. The 2.4.21
kernel currently available on SLES8 provides a 64-bit foundation for the
execution of either 32- or 64-bit applications in real-time.
The
soon-to-be released SLES9 is currently in beta, as SUSE puts the finishing
touches on a new GCC, glibc, and Linux 2.6 kernel combination. At its
release, SLES9 will offer the first Linux 2.6 kernel for IBM eServer™ iSeries® and
pSeries® servers.
Which distribution to use?
Due to the differences in threading models offered by RHEL3 and SLES8,
complete binary compatibility cannot be taken for granted. The good news
is, developers nearly always find code builds compatible across Linux
distributions, and Linux on POWER is no exception.
However, in the case of deployment, some applications make more sense on a specific distribution. For example, the Reiser File System, available by default
on SLES8, is known for its high performance with small files. An
application that focuses on the read and write access of files smaller
than 1 KB will benefit from this file system's availability, and
thus may be best running on SLES8, whereas applications running Java
threads will benefit from the RHEL3 implementation of NPTL.
The virtue of
the open source model is flexibility, and Linux on POWER is flexible.
That said, developers will also find a commonality of resources for
development on either RHEL3 or SLES8. Compilers, the IBM Java Developer's
Kit, and development tools like the popular integrated development
environment Eclipse are all examples of tools freely available for either
distribution.
Compilers and libraries
Linux on POWER is the union of two worlds: the best of open source
development and enterprise-class hardware. It's only fitting to provide a
choice of C, C++, and Fortran compilers that reflect this union.
GNU Compiler Collection (GCC)
GNU GCC is the most widely used compiler on Linux across all
architectures and is the compiler used by both Red Hat and SUSE to
compile the binaries distributed with their products. Capable of
generating both 32- and 64-bit binaries, GCC 3.2 is offered on both RHEL3
and SLES8. The RHEL3 implementation utilizes a
"biarch" style twin compiler, with which a compiler flag (-m64) is used to
enable 64-bit compilation.
SLES8, alternatively, uses a separate
toolchain for 64-bit GCC, stored by default in /opt/cross. In order to
enable the 64-bit GCC compiler in SLES8, developers should ensure that
their configure scripts and Makefiles are aware of this compiler. You can accomplish this
by assigning the CC environment
variable to the 64-bit GCC compiler's location.
Currently, the GNU Compiler Collection is undergoing a massive renovation
regarding performance optimization for the POWER architecture. In the
upcoming 3.3 and 3.4 releases, GCC will have improved scheduling and signal
handling. In addition, architecture-specific optimizations (such as VMX/Altivec support on PPC970
chips featured in the IBM JS20 BladeCenter) will deliver a dramatic
performance advantage to compiled code. However, both SLES8 and RHEL3
currently employ GCC 3.2 versions, and a review of performance
optimization for these versions of GCC is provided here.
GCC 3.2 lacks architecture-specific optimizations for POWER processors.
Therefore, it is not recommended to compile with architecture-specific
flags, such as -mpower. These options are available, but often offer no
performance advantage. In contrast to GCC implementations on x86, the
-fPIC flag is not implied. In order to generate dynamically linked
binaries, include -fPIC in all Makefiles. This is especially
key if you are porting a codebase from Linux on Intel, since this
flag may not be explicitly used in existing Makefiles.
In addition to awareness of flags not utilized by current releases of GCC
for POWER architecture, you should be aware of common flags
available to both x86 and POWER architecture. These include compile flags
dealing with relocation, table of contents sizes, floating point options,
bit alignment, and so on. For example, large TOC support (greater than 8K
entry) requires multiple TOCs, specified with the -mminimal-toc compile
flag. For a review of these, see standard GCC documentation packaged with
the source.
IBM VisualAge Compiler Set
In addition to GCC, IBM has made available for both RHEL3 and SLES8 a
release of the high-performance VisualAge Compiler Set. These compilers
for C, C++, and Fortran, are pinnacles of performance optimization
technology; they are also custom crafted to exploit the POWER architecture
to the fullest extent. High Performance Computing developers often see
upwards of 30 percent performance improvements just by recompiling their code
with these compilers!
Optimization with VisualAge can be as easy as using the preset
optimization levels, which will incorporate various categories of
algorithm. In general, significant performance improvements are seen with
a simple -O3 -qtune=auto and -qarch=auto. Third-level optimization will
offer chip- (but not architecture-) independent optimization with
autodetection of the chip model. Stepping up to the -O4 optimization
flag will buy incremental performance derived from chip-specific
optimizations, interprocedural analysis, and high-order transformation
routines. High-performance code should first be optimized at -O3, and
then attempted at -O4. Though -O4 will likely add performance, it is also
more selective about the code structure and more restrictive to binary
compatibility within the POWER microprocessor line.
To avoid nightmarish scenarios of library incompatibility, the VisualAge
compilers for Linux on POWER have been designed to use the glibc packaged
with each distribution respectively, and they even use the native Linux
linker. Applications that are thirsty for performance have an obvious
ally with this unique offering for Linux on POWER.
Extensive documentation on compile-time optimization is available for
both the GCC and VisualAge compiler set for Linux on POWER.
Freely available technical resources any Linux on POWER developer should
have on the desktop are listed in Resources.
IBM SDK 1.4.1
IBM has poured development resources into the refinement of a customized
SDK, available in both 32- and 64-bit for Linux on POWER. Both RHEL3 and
SLES8 are packaged with the IBM SDK 1.4.1, and can be used in combination
with the Eclipse Integrated Development Environment for Linux on POWER.
Development tools
Many Linux developers are happy with traditional development environments
like vi or Emacs. Naturally, these are available, along with kernel-level
debugging tools common to Linux such as gdb. However, in addition to
these tools, Linux on POWER also features support for development tools
like the Eclipse IDE. The VisualAge compilers have detailed code analysis
options to assess endianness and 64-bit compatibility in source code, and
the comfortable KDE and Gnome desktop environments make the graphically
inclined developer feel right at home. High Performance Computing (HPC) and
Life Science developers will benefit from the availability of common
applications, for example NCBI applications. IBM's advanced mathematics
and scientific libraries ESSL and P/ESSL are also available to aid HPC
applications for Linux on POWER. Grid computing comes to life for Linux
on POWER with respected solutions such as the Globus Toolkit combined with
clustering tools like Cluster Systems Management (CSM).
 |
Summary
Linux on POWER offers you a high-performance home for applications
that need to take a step up to more robust hardware, while providing a
full set of hardware and software resources. 64-bit applications can
coexist peacefully with 32-bit applications in the twin execution
environment. The IBM iSeries and pSeries lines bring a robust hardware foundation
that was previously unavailable to Linux. Red Hat and SUSE have worked diligently to make available the best in open source
distributions, as has IBM to provide leading middleware solutions familiar
to AIX developers. New development tools like
Eclipse make transitions easy, and cutting-edge development environments
provide both the flexibility and performance expected from this union of
Linux and IBM iSeries and pSeries servers.
Resources
About the author  | |  |
Matt Davis is a Linux technical consultant in the IBM eServer Solutions
Enablement team. As a member of the pSeries Linux project since its
inception, he explored and tested emerging technology for pSeries Linux
and wrote several reports summarizing his findings. These include
Journaling File Systems for Linux for POWER, Parallel Grid Computing with
Linux for POWER, Open Source Alternatives to Commercial Software for Linux
for POWER, and the Linux Solutions Catalog. He came to IBM as an intern
while a student at the University of Texas at Austin, where he earned two degrees. He can be reached at mattdavis@us.ibm.com.
|
Rate this page
|