Download downloaded

Transcript
10/17/06
Installation and Getting Started
4
Now, you should be able to compile nab programs. Eventually, you may wish to define the environment variable $NABHOME and add the path to the binary executable of nab explicitly in your .cshrc
file (or equivalent in other shells) to avoid having to redefine these variables at each new login.
1.2. Compiling nab Programs.
Compiling nab programs is very similar to compiling other high-level language programs, such as C
and FORTRAN. The command line syntax is
nab [-O] [-c] [-v] [-noassert] [-nodebug] [-o file] [-Dstring] file(s)
where
-O optimizes the object code
-c suppresses the linking stage with ld and produces a .o file
-v verbosely reports on the compile process
-noassert causes the compiler to ignore assert statements
-nodebug causes the compiler to ignore debug statements
-o file names the output file
-Dstring defines string to the C preprocessor
Linking FORTRAN and C object code with nab is accomplished simply by including the source files
on the command line with the nab file. For instance, if a nab program bar.nab uses a C function
defined in the file foo.c, compiling and linking optimized nab code would be accomplished by
nab -O bar.nab foo.c
The result is an executable a.out file.
1.3. Parallel Execution
The generalized Born energy routines (for both first and second derivatives) include directives
that will allow for parallel execution on machines that support this option. Once you have some level
of comfort and experience with the single-CPU version, you can enable parallel execution by supplying one of several parallelization options (-openmp, -mpi or -scalapack) to configure, by re-building
the NAB compiler (see section 1.1 above) and by recompiling your NAB program (see section 1.2
above).
The -openmp option enables parallel execution under OpenMP on shared- memory machines. To
enable OpenMP execution, add the -openmp option to configure, re-build the NAB compiler and recompile your NAB program. Then, if you set the OMP_NUM_THREADS environment variable to