ARSC HPC Users' Newsletter 267, April 18, 2003



George Lake's New Role at ARSC and UA

The Arctic Region Supercomputing Center has accepted a unique opportunity to temporarily hire Professor George Lake as Visiting President's Professor and ARSC Chief Scientist. Lake has built and continues in a distinguished career in computational research spanning astronomy, physics and bioinformatics.

Dr. Lake will assume several major roles at ARSC over the five to six month term of his appointment. First, he will work to stimulate computational research in the ongoing scientific areas ARSC has chosen for investment across the University of Alaska, including bioinformatics and climate modeling. His activity across the Institutes and Colleges will also catalyze increased large-scale computational research by UA faculty and students. Second, he will serve as a magnet to attract applications of high performance computing to ARSC. Thus extending the center's national reputation for support of science beyond Alaska.


ARSC System-Wide Downtime, Reminder

This repeats an announcement made earlier to ARSC users regarding upcoming downtime:

SCOPE: ARSC Computer Facility Outage
START TIME: Saturday, 4/26/03, 5:00 p.m. Alaska time
END TIME: Sunday, 4/27/03, 6:00 p.m. Alaska time
DURATION: 25 hours
DESCRIPTION: The ARSC computing facility is undergoing major improvements to the mechanical and electricalplant to support new computing equipment being installed in May.
AFFECTED CUSTOMERS: All ARSC computer hosts and systems will be unavailable.
CONTACT INFORMATION: If you have any questions, please contact the ARSC Help Desk: ( or450-8602).

Testing ISO C++ Conformance with Cray PE 3.6

[ Many thanks to Shawn Houston of ARSC for this contribution. ]

As part of a work related assignment to provide the C++ Standard Template Library (STL) on our Cray platforms, yukon (T3E) and chilkoot (SV1ex), I learned that Programming Environment release 3.6 (PE 3.6) was going to not only include the STL, but that the C++ compiler would be mostly ISO C++ conforming.

I gathered together some sample programs, plus one major application, and set about testing the actual ISO C++ compliance of PE 3.6 C++.

The first test involves the new C++ header file naming convention. Before C++ became a standard, headers followed the naming convention used in C (an extension of ".h"). The standard strongly encourages extension free filenames for include files. Cray's PE 3.6 supports the standard, and this test passed.

The next test is for the new scoping rules, the most obvious test being block scope extension to "for" loops. The following code snippet illustrates:

  int testme(int testval)
    int i = testval;
    for(int i = 0; i < 2*testval; ++i)
      // do something here
    if(i == testval)
      return 0;
    return i;

The standard requires that this not only compile, but that the return value be zero. For this code to compile the Cray compiler requires the "-h conform" flag. The test does return zero, as hoped.

Next I tested features of the STL. Although not a comprehensive test, the test programs were many, and some were fairly large, so I am not including them here. I could not find any abnormalities in the Cray STL. PE 3.6 provides a very good STL implementation.

My final test included one of the larger C++ applications I use, and compiling it under PE 3.6. It was during this exercise that I discovered limitations in using the "-h conform" flag. Cray has stated that the "-h conform" flag is less tested than the rest of the compiler, but this is not made evident in the CC man-page.

The application consists of a library with about 5,000 lines of code, and a main program of about 17,000 lines of code. This code has an eight year history, starting out with a few hundred lines of cfront code in the library, growing to its present size as features were added, and converted to mostly ISO C++ about three years ago. This program leverages the STL heavily, but avoids the less supported C++ standard requirements. Before compiling, I converted the remaining include directives for header files defined by ISO C++ to the extension-free versions, "cstring," "cstdio," and so on. Then I tried to compile using the "-h conform" flag.

I found that the following functions are not defined when using "-h conform":


There may be many more, but these are the ones that caused trouble for my application. These functions are either depreciated, or are not ANSI C, and they further reflect the age of this code base. The only function that was a complete show stopper was the "kill" function. I was not able find a suitable replacement for "kill." Replacing "bzero" with "memset," and "bcopy" with "memcpy" was straight forward. Creating C++ string and C string replacements for the two string compare functions was trivial. Last, "fdopen" can be replaced by doing a raw read on the file descriptor. I did give up after many hours of code replacement, or workarounds, without a final binary.

I then recompiled the application test case, omitting the "-h conform" flag, without error. This is only because I had avoided block scoping problems while dealing with other non-conforming compilers, on other systems. The only compile failure was because the "realpath" function does not exist on the Crays. As this is a rarely used function, I do not consider this an error.


In conclusion, the PE 3.6 STL is complete, and in my tests performed as expected. The "-h conform" flag provides very good ISO C++ conformance, but will not work for programs that depend on non-ANSI C constructs. The application test was conducted solely on yukon (T3E). The STL and scoping rule tests were conducted on both the T3E and SV1ex, and behaved identically on the two. These tests were conducted based on my experience with C++, not with the ISO C++ standard as a reference.


Quick-Tip Q & A

A:[[ I did "du -sk" of a directory, I got 320 Mbytes, then I made a tarfile
  [[ of the directory, and it was near 1 GByte!  What happened?

  The missing clue... it was done on one of the Crays...

  Cray "du -sk" doesn't report migrated files.  Tar, of course,
  retrieves migrated files before it can include them in a tar file,
  where they add to the final tar size.

  "du -skm" does include migrated files in the size report, as shown in
  this example (the "m" in column 1 of the "ls -l" output indicates the
  file is not on disk, but migrated to tape):

    total 160
    -rw-------   1 gertrude hergroup      27 Oct 28  1996 PE2.0
    -rw-------   1 gertrude hergroup    2438 Oct 28  1996 PE2.out
    mrwx------   1 gertrude hergroup 2513824 Oct 28  1996 craft1*
    -rw-------   1 gertrude hergroup     274 Oct 28  1996 makefile
    -rw-------   1 gertrude hergroup    2438 Oct 28  1996 PE1.out
    -rw-------   1 gertrude hergroup    4327 Jun 17  1996 craft1.f
    96      CRAFT
                1024 byte blocks
     on-line    off-line  dual-state  file/directory   
          96        2456           0  CRAFT
  CHILKOOT$ ls -l CRAFT.tar
    -rw-------   1 gertrude hergroup 2555904 Apr 18 10:22 CRAFT.tar

Q: I assign a full path and file name to an environment variable, with
   a result similar to this:

     setenv FILENAME /usr/local/include/mpi.h

   at one point, all I want is just the file name:


   These annoying little details are just like mosquitoes. So, can I
   strip off the path without writing yet another little perl script?
   Or do I bite the bullet?

[[ Answers, Questions, and Tips Graciously Accepted ]]

Current Editors:
Ed Kornkven ARSC HPC Specialist ph: 907-450-8669
Kate Hedstrom ARSC Oceanographic Specialist ph: 907-450-8678
Arctic Region Supercomputing Center
University of Alaska Fairbanks
PO Box 756020
Fairbanks AK 99775-6020
E-mail Subscriptions: Archives:
    Back issues of the ASCII e-mail edition of the ARSC T3D/T3E/HPC Users' Newsletter are available by request. Please contact the editors.
Back to Top