How to compile FDS 4 with MPICH and Compaq Visual Fortran
- Subject: How to compile FDS 4 with MPICH and Compaq Visual Fortran
- From: Kevin McGrattan <kevin.mcgrattan@nist.gov>
- Date: Fri, 22 Aug 2003 15:30:40 -0400
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- Organization: NIST
- References: <42256D39.002E007F.00@rtes2.rte.vtt.fi>
- Sender: mcgratta
All
The following information was provided by Simo Hostikka of
VTT who compiled
FDS 4 on a network of Windows computers. For those of you
who do not have a
Fortran compiler of any kind, you can get the executable
file fds4_mpi.exe from
my ftp site and then follow the directions of installing
MPICH and running the
code. Those without a compiler can skip steps 3 and 4 below.
Install MPICH, an implementation of MPI from Argonne
National Labs, USA
=======================================================================
1. Download the Windows version of MPICH from
http://www-unix.mcs.anl.gov/mpi/mpich/download.html
2. Install MPICH for each machine. The SDK needs to be
installed
only on the machine you use for compiling FDS.
Compile the FDS 4 source code using Compaq Visual Fortran
=========================================================
3. Create a new project for a Fortran Console application
4. Apply the following settings:
4.1. Project-->Settings-->C/C++, Pre-processor Definitions,
Add the phrase
pp_noappend
4.2. Project-->Settings-->Link, Output, Stack Allocations
50000000
4.3. Project-->Settings-->Link, General, add dfor.lib to
the beginning
of the list of objects
4.4. (older versions of compiler)
Project-->Settings-->Fortran; Libraries;
Check "Use Debug C Libraries"
4.5. Project-->Settings-->Link Input,
add C:\Program Files\MPICH\SDK\LIB to 'Additional
Library Path'
4.6. Project-->Settings-->Fortran Preprocessor,
add C:\Program Files\MPICH\SDK\INCLUDE to 'INCLUDE AND
USE PATHS'
4.7. Project-->Settings-->Link Input, add ws2_32.lib and
mpich.lib to list
of objects/libraries.
4.8. Under Project-->Settings-->Fortran External
Procedures, set Argument
Passing Conventions to "C. By Reference", and String
Length Argument
Passing to "After All Args".
(equivalent to /iface:cref /iface:nomixed_str_len_arg)
4.9. Import source files, inluding main_mpi.f, but not
main.f (this is for serial
version)
4.10 Build (and pray!)
How to run Parallel FDS 4 under Windows
=======================================
5. Make sure that each machine can find the TCP/IP address
of other
machines by name. This can be ensured by adding the IP
address-name
combinations to the
C:\Windows\system32\drivers\etc\hosts file.
6. Parallel jobs are launched either using the graphical
MPIRun interface,
or by executing mpirun from the command line. For easier
use,
add directory C:\Program Files\MPICH\mpd\bin to PATH. To
do this, under
My Computer-->Properties-->Advanced-->Environment
Variables, add the
above directory name to the Path list.
For command line use, the easiest way to define things
for mpirun
is to use a configuration file. Two examples of the
config.txt for a job
containing three blocks, are shown below.
A. fds4_mpi.exe is located in the same place on each
computer, and both
computers machine1 and machine2 can see the current
directory. Here we
are using 2 processors on machine1 (or two threads if
machine1 only has
one processor), and 1 processor on machine2.
exe C:\nist\fds\fds4_mpi.exe
hosts
machine1 2
machine2 1
B. fds4_mpi.exe can be found on the servermachine, and
the working
directory \fds\test is on a shared drive of machine1.
exe \\servermachine\nist\fds\fds4_mpi.exe
dir \\machine1\fds\Test
hosts
machine1 2
machine2 1
To start the simulation, type 'mpirun config.txt' on the
command line.
Remember that the input file name should be written into
a file called fds.data
See MPICH documentation for additional information.
Kevin's note: I followed this procedure and was able to run
a parallel job over the
network. I followed route A, plus I added explicitly the
directory name to the
configuration file, as shown in route B. Best not to assume
anything. Make sure
the working directory is fully "shared" since all computers
have to write files into
it. I think that this is the biggest impediment to parallel
processing -- you must make the connection between machines
as transparent as possible. Have the same username and
password on all machines. Check that all machines can "see"
each other. And be patient. Unless you have done this
before, and even if you have, there are going to be
problems. If you are not in the mood for computer nonsense,
don't do this right now. We're going to try to streamline
the process to make it less painful. Plus we still need to
work out some bugs in the parallel code.
Good luck, and let me know if you succeed or fail at this.
Kevin
--
Kevin McGrattan
National Institute of Standards and Technology
100 Bureau Drive, Stop 8663
Gaithersburg MD 20899-8663
Telephone: (301) 975 2712
FAX: (301) 975 4052
Date Index |
Thread Index |
Problems or questions? Contact list-master@nist.gov