Instructions for running a SWAN model ------------------------------------- Windows 7/8.1/10 ---------------- *) Before running, first adapt the environment variable PATH by including the pathname of the directory where swan.exe can be found. This pathname can be specified through the category System of Control Panel, on the Advanced tab, click Environment Variables. *) You may also need to add the directory path where bin of MPI is resided to PATH to have access to the command mpiexec.exe or mpirun. *) Open a command prompt and change to the directory where your application is resided. *) Execute the batch-file swanrun.bat as follows: swanrun SWAN-inputfile [nprocs] where SWAN-inputfile is the name of your inputfile without extension (it is assumed that the extension is '.swn') 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. This script is also suited when no MPICH2 is available (of course, nprocs must be 1). This script is also suited for multi-core PC provided that SWAN source code with OpenMP directives is compiled. The parameter 'nprocs' must be set to 1. UNIX or Linux ------------- *) The name of the SWAN-executable must be swan.exe. Furthermore, adapt the environment variable PATH by including the pathname of the directory where this executable can be found. *) Use the script swanrun. To execute this script, it will need to be executable first, so chmod +rx ./swanrun *) This script can be used as follows: ./swanrun -input SWAN-inputfile [-omp n | -mpi n] [> swanout &] where SWAN-inputfile is the name of your inputfile without extension (it is assumed that the extension is '.swn') and n is the number of processors. The parameter '-omp n' specifies a parallel run on n threads using OpenMP. The parameter '-mpi n' specifies a parallel run on n cores using MPI. The parameter '-input' is obliged, whereas the parameters '-omp n' or '-mpi n' can be omitted (default: n=1). This script is also suited when no MPI is available (of course, n must be 1). You may redirect the output of swanrun to the file swanout (in this case). It is also possible to run your model in the background as indicated by the ampersand. *) 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. You can specify a number followed by a colon after the node name to indicate how many processes 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 file: node1 node2:2 node4 node7:4