ARCHIVED: At IU, how do I access the NAG library on Libra?
NAG (Numerical Algorithms Group) is a collection of Fortran subroutine libraries. NAG Mark 18 is available on the Libra Cluster at Indiana University.
Note: UITS will retire Libra in spring 2009. Accounts are available on Quarry, a general-purpose Unix computing environment. For more, see ARCHIVED: About the Libra retirement.
Accessing the NAG library from Libra
- To access the library, at the system prompt, enter:
xlf -o program -lnag program.f
program < data.d > output
Replace
xlf -o nagjob -lnag nagjob1.f nagjob < nagjob1.d > nagjob1.outprogram,program.f, anddata.dwith your own parameters. For example, to compile and link your command file callednagjob1.fand your data file callednagjob1.dand store the output asnagjob1.out, at the system prompt, enter:If the data file is embedded within the program, you can omit the datafile parameter.
- You must submit CPU-intensive jobs (requiring more than 20 minutes
of CPU time) to IBM's LoadLeveler batch queuing system. Two classes of
queues are available for NAG jobs on Libra. Class A is for jobs
requiring up to 24 hours of CPU time, and Class B is for jobs
requiring more than 24 hours of CPU time.
To submit a NAG job to LoadLeveler, create a script file (e.g.,
#@ initialdir = /'directory' #@ error = 'nagjob.err' #@ class = a #@ queue xlf -o myjob -lnag myjob.f myjob < datafile > outputfilenagwork) with the following lines:Replace
directorywith the directory where the command file is stored,inputfilewith the name of the NAG command file,datafilewith the name of the data file, andoutputfilewith an appropriate name to store the output. The error/log file will be stored in the same directory in a file namednagjob.err.Note: The line
class = ais for jobs that require up to 24 hours of CPU time. If your job is going to require more than 24 hours of CPU time, replaceclass = awithclass = b. - To submit the job, at the system prompt, enter:
llsubmit nagwork
The output files will be stored in the directory specified in the script file. You may log out after submitting the job.
Help files
NAG help is an extensive online help system that defaults to use your
workstation window system (X Window System or compatible).
A number of files with general information regarding NAG Mark 18
(e.g., user notes, news, a summary of all the routines) are stored in
the directory /libapps/naglib18/flib618da/doc/. The user
notes contain detailed information on how to access the different NAG
libraries. The /nag/examples/ directory contains a source
directory and a data directory with sample programs and corresponding
data files. You may view, copy, or print files from any of the above
directories.
To access NAG online help, at the system prompt, enter
naghelp .
For help on a specific topic, you can enter either of the following commands at the system prompt:
naghelp topic naghelp -tscript filename topic
Replace topic with the topic for which you want help; you
do not have to supply a topic. If you specify the
-tscript option, a transcript of the session (if enabled
during the session) is written to the specified file.
NAG documentation is available for reference at the Swain, Business/SPEA, and Education Libraries and at the UITS Stat/Math Center. You can also order documents through the bookstore in IMU M074.
Note: For more details about the NAG and other subroutine libraries (including information about how to compile, link to, and run programs that invoke them), see the IU High Performance Applications subroutine library page.
Last modified on June 30, 2009.







