next up previous
Next: Testing the system Up: swashimp Previous: User dependent changes and

Usage of SWASH executable

To help you in editing an command file for SWASH input, the file swash.edt is provided.

Two run procedures are provided among the source code, one for the Windows platform, called swashrun.bat, and one for the UNIX/Linux platform, called swashrun. Basically, the run procedure carries out the following actions:

On other operating system a similar procedure can be followed. For parallel MPI runs, the program mpirun or mpiexec is needed and is provided in the MPICH2 distribution.

Before calling the run procedure, the environment variable PATH need to be adapted by including the pathname of the directory where swash.exe can be found. In case of Windows, this pathname can be specified through the category System of Control Panel (on the Advanced tab, click Environment Variables). In case of UNIX or Linux running the bash shell (sh or ksh), the environment variable PATH may be changed as follows:
export PATH=${PATH}:/usr/local/swash
if /usr/local/swash is the directory where the executable swash.exe is resided. In case of the C shell (csh), use the following command:
setenv PATH ${PATH}:/usr/local/swash

If appropriate, you also need to add the directory path where the bin directory of MPICH2 is resided to PATH to have access to the command mpiexec.

The provided run procedures enable the user to properly and easily run SWASH both serial as well as parallel. Note that for parallel MPI runs, the executable swash.exe should be accessible by copying it to all the multiple machines or by placing it in a shared directory. When running the SWASH program, the user must specify the name of the command file. However, it is assumed that the extension of this file is sws. Note that contrary to UNIX/Linux, Windows does not distinguish between lowercase and uppercase characters in filenames. Next, the user may also indicate whether the run is serial or parallel. In case of Windows, use the run procedure swashrun.bat from a command prompt:

swashrun filename [nprocs]
where filename is the name of your command file without extension (assuming it is sws) and nprocs indicates how many processors need to be launched for a parallel MPI run (do not type the brackets; they just indicate that nprocs is optional). By default, nprocs = 1.

The command line for the UNIX script swashrun is as follows:
./swashrun -input filename -mpi n
where filename is the name of your command file without extension. Note that the script swashrun need to be made executable first, as follows:
chmod +rx ./swashrun
The parameter -mpi n specifies a parallel run on n cores using MPI. The parameter -input is obliged, whereas the parameter -mpi n can be omitted (default: n = 1). To redirect screen output to a file, use the sign >. Use an ampersand to run SWASH in the background. An example:
./swashrun -input l51con01 -mpi 4 > swashout &

For a parallel MPI run, you may also need a machinefile that contains the names of the nodes in your parallel environment. Put one node per line in the file. Lines starting with the # character are comment lines. You can specify a number after the node name to indicate how many cores to launch on the node. This is useful e.g., for multi-core processors. The run procedure will cycle through this list until all the requested processes are launched. Example of such a file may look like:

# here, eight processes will be launched
Note that for Windows platforms, a space should be used instead of a colon as the separation character in the machinefile.

SWASH will generate a number of output files:

next up previous
Next: Testing the system Up: swashimp Previous: User dependent changes and
The SWASH team 2017-04-06