November 24, 2009, Tuesday, 327

WOLFSIM:Install

From OLEG

Jump to: navigation, search

Contents

NOTE: RELOCATION

These are for an outdated version of wolfsim, but will remain here for users that wish to continue using that version. The new versions installation instructions are here:

Sourceforge Webpage

Navigation


Preamble

The new version of WOLFSIM prefers to use HDF5 (but not required), which is a file format for scientific data. The basic procedure for installation is as follows:

  1. Download and install HDF5 (see steps below)
  2. Download and un-archive WOLFSIM and WOLFSIM_GUI (see Download Page)
  3. Compile WOLFSIM

You can find the complete instructions and download all requiredpackages for HDF5 at the following website:

http://hdf.ncsa.uiuc.edu/HDF5/release/obtain5.html

Why bother? If you don't want to spend time to learn HDF5,you still have the version of WOLFSIM with all new features but without HDF5.For the version without HDF5, go to Section 2 (skip Section 1).However, it might be a good chance to learn one of the most advanced scientific data formats.


HDF5 Installation (recommended)

Acquiring HDF5 Files

For most systems (Windows, PowerPC-based Macintosh,Linux, Sun), there are three steps to install HDF5 as follows (following theinstructions from the HDF5 website):

  1. Download and install the SZIP
  2. Download and install the ZLIB
  3. Download and install the HDF5 for your OS

For Intel-based Macintosh computers, you must buildand install the HDF5 from the source package, not binaries. While it is possible to install itmanually using Terminal commands, it is easiest to do the following:

  1. Install Fink(Open Source)
  2. Install and open the graphical user interface FinkCommander (Open Source)
  3. In FinkCommander, simultaneously highlight HDF5, HDF5-bin,and HDF5-shlibs and select the SOURCE:INSTALL menu. Follow the directions and allow all additional dependentsoftware to be installed. This maytake between 30 and 90 minutes depending on your system.


(optional) Verify HDF5 Application Compile

Once you complete the HDF5 installation, we recommend you totest one of the sample codes (e.g. h5write.c) within the HDF5 directory beforecompiling WOLFSIM. This willverify that HDF5 is installed correctly. The HDF5 package provides the h5cc(C), h5c++(C++), h5fc(F90) utilitiesfor compiling applications. Beforeyou compile your codes, you must first

  1. Run ./h5redelpoy to change site specific paths in the scripts
  2. Edit each script and update the paths for the externallibraries in LDFLAGS and CPPFLAGS (ZLIB, SZIP)

After the above steps, you are ready to compile. The example script for gcc compiler onMac:

>> h5cc -o h5write h5write.c 


Install HDFView

To visualize HDF5 data (apart from using Matlab or othersoftware), you need HDFView. For most systems (Windows, PowerPC-based Macintosh, Linux, Sun), you canobtain the current version of HDFView from the following website: http://hdf.ncsa.uiuc.edu/hdf-java-html/hdfview/

For Intel-based Macintosh computers, a beta versionof HDFView is available from ftp://ftp.hdfgroup.org/HDF5/hdf-java24-beta/hdfview/ and download hdfview_install_macosx_intel_novm.zip


Using Matlab

We often find that Matlab is useful for post-processing(i.e., generating figures). Thereis a built-in function of Matlab to read HDF5 data – hdf5read(filename,datasetname). We provide a sample M-code HDF5_Read.mto read all the data from Result.h5. This M-code stores the data in a single structure array (Result) and savesa Matlab data file Result.mat in the same directory.


Download WOLFSIM and WOLFSIM_GUI

If you have not already done so, download the WOLFSIM andWOLFSIM_GUI archives from the download page: http://www.ece.ncsu.edu/oleg/wolfsim_download.html


Compile WOLFSIM

If HDF5 and your C/C++ compiler are installed correctly, youare ready to compile the WOLFSIM.

  1. Unzip the WOLFSIM package (suggested to be put into its owndirectory)
  2. Compile WOLFSIM using the appropriate command-lineinstruction. Manyprocessor-specific flags can be invoked, but the most basic is the following:
>> h5cc -o wolfsim WOLFSIM.c 

For the version without HDF5,

>> gcc -o wolfsim WOLFSIM.c                                                                         

On many systems, the following compile command leads to an optimized executablethat will run faster simulations. As background for this, we note that in GCC4.0, "-fast" is amagic optimization flag, which enables many other options including"-floop-optimize". SinceWOLFSIM includes a large number of loops, "-floop-optimize" willimprove the performance. In addition, GCC4.0 provides auto vectorization and itcan be enabled by "-ftree-vectorize". Therefore, the following command is particularly effectiveon dual processor Alti-Vec systems (e.g. Apple PowerMac Dual G5):

>> h5cc -fast -ftree-vectorize -o wolfsimWOLFSIM.c                                         

For the version without HDF5,

>> gcc -fast -ftree-vectorize -o wolfsim WOLFSIM.c                                                                         


Running WOLFSIM

To run a simulation, you must have Input.txt file in thesame directory as the WOLFSIM executable (named wolfsim in the abovesteps). For the initial test, youmay use the default Input.txt file and use the following command to run WOLFSIMin the same directory:

>> ./wolfsim


The New User Interface WOLFSIM_GUI

New in this version of WOLFSIM is a Graphical User Interface(GUI) written in Java. This allows for easy model definition and simulationsetup.

  1. Install a current version of Java.
  2. Unzip the WOLFSIM_GUI.zip archive (suggested to put into yournormal Applications or Programs folder, but anywhere will do). It does not need to be in the samedirectory as WOLFSIM, and only one copy of the GUI need be installed percomputer.
  3. Open the java application WOLFSIM_GUI.jar
  4. Utilize this GUI to configure the model and simulationparameters, then generate the Input.txt file in the last Tab. This Input.txt file can then be used asthe input to running WOLFSIM as described in the previous section.

The first Tab (About) includes brief descriptions for options of the other Tabs.