Blockstructured Adaptive Mesh Refinement in object-oriented C++
The installation of the AMROC-package is not trivial, because the codes combine modern object-oriented programming technics in C++ with efficient subroutines in Fortran 77. Fast binary output uses the HDF4-libraries and AMROC's native visualizer is based onto the Fortran-package Visual3. Nearly arbitrary combinations of Fortran- and C++-compilers on different platforms are possible and therefore configuration-files will be missing for some cases.
Installation of AMROC
1. Installing missing packages
1.1 HDF 4.1r5
AMROC uses the hierarchical data format (HDF) for binary output. Go to http://hdf.ncsa.uiuc.edu/hdf4.html and download the binary-distribution for your platform. Set $(HDFLIBS) in amroc.config to the lib-path of your HDF4 installation. The necessary libraries are libdf.a, libjpeg.a, libmfhdf.a, libz.a.
Set $(HDFINCLUDE) in src/src.config to the include-path of your HDF4 installation. These include-files of course are platform-independent. The absolutely necessary files are hcomp.h, hdf.h, herr.h, hntdefs.h, htags.h, mfgr.h, netcdf.h, hbitio.h, hdf2netcdf.h, hdfi.h, hlimits.h, hproto.h, local_nc.h, mfhdf.h, vg.h.
1.2 Visual3
AMROC's native ANR-visualizer hdf2v3 is based on Visual3. The only file that is really required is the Fortran-library libVisual3.a, which should be in $(VISUAL3LIBS). The appropriate Visual3-distribution can be downloaded from http://raphael.mit.edu/visual3/visual3.html.
Linux-versions of libVisual3.a are not available on the Visual3-homepage, but Bob Haimes has granted permission to distribute these version on the AMROC website. The PGF77 variant (TAR.GZ download (767k), TAR download (2.7M)) has been compiled with the Portland Group's Fortran-compiler and requires just the runtime-libraries libpgc.a and libpgftnrtl.a. A trial version of PGF77 can be obtained from http://www.pgroup.com/prodservpgf77.htm. The Intel version (TAR.GZ download (807k), TAR download (2.4M)) has been built with the Intel compiler for Linux that may be optained via http://www.intel.com/software/products/compilers/f50/linux.
By default the building of hdf2v3 is skipped. The remaining HDF-converter hdf2file is able to import AMR-HDF-data into IBM's Data Explorer and can generate two-dimensional cuts from three- dimensional data-sets that can be read directly by Matlab. hdf2file can also be utilized to generate ASCII-tabulars from one-dimensional HDF-data that can be displayed by usual plotting tools, for instance by Gnuplot. Edit visualizer/Makefile to build hdf2v3 additionaly.
2. Configuration
2.1 Compilation process
Platform- and compiler-specific configuration files that are included into the Makefiles are stored in src/defs/$(ARCH)/$(DEBUG). For each predefined configuration three files exits: generic.$(COMP).defs, dagh.$(COMP).defs and visual3.$(COMP).defs. generic.$(COMP).defs is used to set C++- and Fortran-compiler and common options. dagh.$(COMP).defs is included into the Makefiles that build the libdagh.a and all AMR-codes. visual3.$(COMP).defs configures the Makefile that builds the visualization tools.
The main configuration file is amroc.config. Beside the variables for link-libraries, important variables that have to be set in amroc.config are:
$(AMROC) Directory Set this variable to AMROC's main directory. $(ARCH) linux, sp2, sun, irix If your platform is missing, you have create your own path in src/defs with own definition files. $(COMP) gcc, icc, pgi, kai, vac Selects the configuration files for a particular C++-compiler on the chosen platform. $(MPISWITCH) on/off Toggles the building of parallel/serial AMR-codes. Turn it off at first. $(DEBUG) debug/opt For development use debug, for large-scale computations opt. Use debug at first. If you have to adjust the function-names for Fortran-subroutines used within C++ for your environment, modify DAGHFortranInterfaces.h.
2.2 Running simulation codes
The simulation codes can be started directly from the command line, but to simplify the initiation of jobs especially on parallel batch systems and to automatically convert HDF-files after a run, a shell-script run.sh is supplied for each example. It is intended to be run in the background. Use run.sh & for non-MPI jobs and
for MPI jobs. run.sh calls bin/startup.$(ARCH).sh which usually will have to be adjusted appropriately for your local parallel machine.run.sh [No. processors] &
2.3 Visual3
The Visual3-library has a minor flaw! Visual3 is aborted with a core-dump without any warning during startup, if no own valid definitions for its X-Window-fonts are supplied. This usually happens when the program tries to open its first window. The following definitions should be added permanently to .Xresources or .Xdefaults (see also visualizer/Xresources):
Use xfontsel to ensure that fonts defined in Visual*med2 and Visual*large are really available on your local system.Visual*small: 6x10
Visual*medium: 8x13
Visual*med2: -adobe-courier-bold-r-normal--17-120-100-100-m-100-iso8859-1
Visual*large: -adobe-courier-bold-r-normal--25-180-100-100-m-150-iso8859-1
If you are using a Linux system with an 8-bit color depth Xserver you must set the environment variable MESA_RGB_VISUAL to PseudoColor 8 before running Visual3. But the display will look much better, if 12 or more bits/pixel are used in a TrueColor mode so that no dithering is required. If you have a graphics card with enough VRAM it is recommended to start the Xserver in 12, 15 or 24 bits TrueColor mode. Note that Visual3 does NOT support 16 bit.
3. Compilation
All Makefile are written for the GNU Make-utility. Ensure that GNU Make is in your PATH and initiate the compilation of all libraries, all examples and the HDF conversion and visualization tools by starting GNU Make in AMROC's main directory.
See the quickstart guide for a brief description how to run the examples and how to visualize their results.
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 11/4/04