ARSC HPC Users' Newsletter 321, July 29, 2005

XLF -qextname and -brename

We covered this topic in issue 288 , but it's worth repeating.

Occasionally when a user ports their code to an IBM system using the XLF compilers they encounter errors like the following:


  iceberg1 1% make
           xlf90_r -qsuffix=f=f90  myprogram.f90  -o myprogram
  ** myprogram   === End of Compilation 1 ===
  1501-510  Compilation successful for file myprogram.f90.
  ld: 0711-317 ERROR: Undefined symbol: .flush
  ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more 
  information.
  make: 1254-004 The error code from the last command is 8.

  Stop.

Here we see the symbol ".flush" wasn't found during the linking stage. This may be a surprise to users accustomed to other compiler environments. There is a flush subroutine available and it is not hidden away in a secret library.

IBM has chosen to slightly altered the symbols of several Fortran subroutines to avoid linking ambiguities between user and Fortran libraries. If we look at the Fortran 90 library (xlf90_r.a) we see there is a "flush" symbol however it is ".flush_" rather than ".flush"


  iceberg1 2% nm -e /usr/lib/libxlf90_r.a  
 grep flush
  .flush_              T      220408
  flush_               D       46360          12

The xlf compiler flag "-qextname" instructs the compiler to add an underscore to the end of externally defined symbols or the specified symbols. Adding "-qextname=flush" to the compile flags we see that linking now occurs successfully.


  iceberg1 72% make
         xlf90_r -qsuffix=f=f90 -qextname=flush myprogram.f90  -o 
  myprogram
  ** myprogram   === End of Compilation 1 ===
  1501-510  Compilation successful for file myprogram.f90.

There are several other ways to do the same thing. As noted in HPC Newsletter 288, the trailing underscore could be added to the flush subroutine call. E.g.,


  call flush(10)
becomes

  call flush_(10)

This option isn't very graceful since it involves an unnecessary change to the source code.

The last option is to use the linker flag "-brename". This option allows an object symbol to be renamed. In this case we could use "-brename:.flush,.flush_" in our linking flags to steer the linker in the right direction. This option should be considered as a last resort. The linker will not consider parameter types of function/subroutine calls so the use of the "-brename" could create some very unusual errors if used incorrectly. If you decide to use "-brename" be sure to check whether or not the parameters of each symbol match exactly. For more information on "-qextname" see "man xlf" or the "XL Fortran for AIX: User's Guide, Version 8.1.1" (SC09-4946-01).

Here are a few other Fortran subroutines which have a trailing underscore added to the symbol:

  • system
  • getenv
  • dtime
  • etime
  • jdate

ARSC Busy at SIGGRAPH

Don't miss ARSC presentations and performances next week at SIGGRAPH:

Bill Brody and Jesse Niles:

"BLUISculpt and VRcussion":

Live performances in the SIGGRAPH Guerilla Studio of: BLUISculpt, http://www.blui.org/bluisculpt.html , and VRcussion, http://www.blui.org/vrcussion.html .

Roger Edberg:

http://www.siggraph.org/s2005/main.php?f=conference&p=sketches&s=sketches34

"Data-Visualization Strategies for Tsunami Research":

A summary of workflow improvements for animation and real-time rendering of tsunami simulation data. Here's Roger's sketch in .pdf .

Miho Aoki:

http://www.siggraph.org/s2005/main.php?f=conference&p=etech&s=access

"Loose Minds in a Box":

A Collaborative Global Distributed Live Performance with remote performance participants in six states, including, of course, Alaska.

Miho Aoki:

http://www.siggraph.org/s2005/main.php?f=conference&p=edu&s=we

"We Are Too Small To Do That":

Challenges and Opportunities of Computer Graphics Education in Small Art Departments.

Miho Aoki:

http://www.siggraph.org/s2005/main.php?f=conference&p=web&s=application

"Kanji Block":

A new web-based visual application for learning Japanese Kanji characters. Teaching Kanji can be a very complex task because of the multi-faceted nature of the writing system. This application uses a three-dimensional approach to this interface design challenge.

Faculty Camp 2005, Many User Training Opportunities

ARSC's annual three-week Faculty Camp, begins Monday, August 1st.

While certain Faculty Camp events are open only to registered "campers," all ARSC users and potential users are invited to attend any lectures you may find valuable.

Mark your calendar according to the schedule below and contact Tom Logan by email or at 907-450-8624 prior to showing up, in case of schedule changes or "over-booking."

ARSC Faculty Camp is an intensive series of seminars and hands-on experiences, presented by ARSC staff, UAF/ARSC Joint Faculty, and current users, which provides participants with assistance and expertise while they develop individual projects. This year, we're pleased to include several talks from the staff of the IBM Advanced Computing Technology Center.

The majority of the talks are scheduled to take place in the West Ridge Research Building (WRRB) first floor classroom (009), but the first floor conference room (010) will be the "home base" for Faculty Camp activities. Here's the schedule:


ARSC Faculty Camp 2005,
  Talks and Sessions Open to ARSC Users and Potential Users


   TIME        TITLE                                    ROOM
-----------------------------------------------------------------
Tuesday, August 2
   11:00 AM   Data Management                           WRRB 009
   2:00 PM    Batch Queueing Systems & Hands-On         WRRB 009
Wednesday, August 3
   10:00 AM   Cray X1 Overview                          WRRB 009
   11:00 AM   Cray X1 Vector/Performance Programming    WRRB 009
   2:00 PM    Cray X1 Profiling and Debugging           WRRB 009
   3:00 PM    Cray X1 Hands-On                          WRRB 009
Thursday, August 4
   10:00 AM  IBM Overview Angelo Rossi, IBM ACTC        WRRB 009
   11:00 AM  IBM Performance Programming Angelo Rossi   WRRB 009
    2:00 PM  IBM Profiling and Debugging Angelo Rossi   WRRB 009
    3:00 PM  IBM Hands-On Angelo Rossi                  WRRB 009
Friday, August 5
   10:00 AM  Parallel Programming with OpenMP           WRRB 009
    2:00 PM  Co-Array Fortran                           WRRB 009
    3:00 PM  Unified Parallel C Abdullah Kayi, GWU      WRRB 009
Monday, August 8
   10:00 AM  Parallel Programming with MPI              WRRB 009
    2:00 PM  Parallel Programming Hands-On Session      WRRB 009
Tuesday, August 9
   10:00 AM  Visualization Overview                     WRRB 009
    2:00 PM  Visualization Overview                     WRRB 009
Wednesday, August 10
   10:00 AM  Scripting Animations with Maya
    2:00 PM  Using NetCDF                               WRRB 009
Thursday, August 11
   10:00 AM  Visualization Applications                 WRRB 009
    2:00 PM  Visualization Applications                 WRRB 009
Friday, August 12
   10:00 AM  Matlab                                     WRRB 009
    2:00 PM  Matlab Hands-On                            WRRB 009
Monday, August 15
   10:00 AM  IDL                                        WRRB 009
    2:00 PM  IDL Hands-On                               WRRB 009
Tuesday, August 16
   10:00 AM  Visualization Workshop                     WRRB 009
    2:00 PM  Visualization Workshop                     WRRB 009
Wednesday, August 17
   10:00 AM  XD1 Overview Esam El-Araby, GWU            WRRB 009
   11:00 AM  FPGA Overview Esam El-Araby, GWU           WRRB 009
    2:00 PM  ARSC Future Technologies                   WRRB 009

Again, you're welcome to attend talks as a non-camper, but please contact Tom Logan by email or at 907-450-8624 in advance.

Quick-Tip Q & A


A: [[ Is there a way to tell whether or not a gzip file is complete?
   [[ I'd rather not extract the contents, but would like to verify
   [[ that compression operation was successful.


#
# Thanks to Greg Newby and Martin Luthi for responses.
#
"gzip -t" or "gzip --test" will test the integrity of
a .gz file.  You'll get no response (just your prompt back)
if the file is OK, and a 0 (zero) exit status.  If the file
is broken, it will tell you ("crc error" or "not in zip format"
or ...).

If you want to know whether a gzip command was successful,
you can get the exit status.  0 means success.

        gzip asdf.txt
        ^C (cancel before it's done)
        echo $?    or     echo $status
        1

A "true" exit status means something went wrong... suitable for
incorporation into your favorite shell script.




Q: I have a bunch of files that I want to copy to new file names.
   Every file with the pattern "1234" somewhere within the name should
   have "1234" replaced with "4567" in the copy.

   E.g.:
       ab1234.dat -> ab4567.dat
       cd1234efg  -> cd4567efg
    
   I'd like to find a way to automate this process.

[[ 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