| 666 |
\end{verbatim} |
\end{verbatim} |
| 667 |
|
|
| 668 |
|
|
|
|
|
| 669 |
\subsection{Using \textit{genmake2}} |
\subsection{Using \textit{genmake2}} |
| 670 |
\label{sect:genmake} |
\label{sect:genmake} |
| 671 |
|
|
| 827 |
``-standarddirs'' option) |
``-standarddirs'' option) |
| 828 |
\end{itemize} |
\end{itemize} |
| 829 |
|
|
| 830 |
|
\item[\texttt{--mpi}] This option enables certain MPI features (using |
| 831 |
|
CPP \texttt{\#define}s) within the code and is necessary for MPI |
| 832 |
|
builds (see Section \ref{sect:mpi-build}). |
| 833 |
|
|
| 834 |
\item[\texttt{--make=/path/to/gmake}] Due to the poor handling of |
\item[\texttt{--make=/path/to/gmake}] Due to the poor handling of |
| 835 |
soft-links and other bugs common with the \texttt{make} versions |
soft-links and other bugs common with the \texttt{make} versions |
| 836 |
provided by commercial Unix vendors, GNU \texttt{make} (sometimes |
provided by commercial Unix vendors, GNU \texttt{make} (sometimes |
| 843 |
a Bourne, POSIX, or compatible) shell. The syntax in these |
a Bourne, POSIX, or compatible) shell. The syntax in these |
| 844 |
circumstances is: |
circumstances is: |
| 845 |
\begin{center} |
\begin{center} |
| 846 |
\texttt{/bin/sh genmake2 -bash=/bin/sh [...options...]} |
\texttt{\% /bin/sh genmake2 -bash=/bin/sh [...options...]} |
| 847 |
\end{center} |
\end{center} |
| 848 |
where \texttt{/bin/sh} can be replaced with the full path and name |
where \texttt{/bin/sh} can be replaced with the full path and name |
| 849 |
of the desired shell. |
of the desired shell. |
| 851 |
\end{description} |
\end{description} |
| 852 |
|
|
| 853 |
|
|
| 854 |
|
\subsection{Building with MPI} |
| 855 |
|
\label{sect:mpi-build} |
| 856 |
|
|
| 857 |
|
Building MITgcm to use MPI libraries can be complicated due to the |
| 858 |
|
variety of different MPI implementations available, their dependencies |
| 859 |
|
or interactions with different compilers, and their often ad-hoc |
| 860 |
|
locations within file systems. For these reasons, its generally a |
| 861 |
|
good idea to start by finding and reading the documentation for your |
| 862 |
|
machine(s) and, if necessary, seeking help from your local systems |
| 863 |
|
administrator. |
| 864 |
|
|
| 865 |
|
The steps for building MITgcm with MPI support are: |
| 866 |
|
\begin{enumerate} |
| 867 |
|
|
| 868 |
|
\item Determine the locations of your MPI-enabled compiler and/or MPI |
| 869 |
|
libraries and put them into an options file as described in Section |
| 870 |
|
\ref{sect:genmake}. One can start with one of the examples in: |
| 871 |
|
\begin{rawhtml} <A |
| 872 |
|
href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/tools/build_options/"> |
| 873 |
|
\end{rawhtml} |
| 874 |
|
\begin{center} |
| 875 |
|
\texttt{MITgcm/tools/build\_options/} |
| 876 |
|
\end{center} |
| 877 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 878 |
|
such as \texttt{linux\_ia32\_g77+mpi\_cg01} or |
| 879 |
|
\texttt{linux\_ia64\_efc+mpi} and then edit it to suit the machine at |
| 880 |
|
hand. You may need help from your user guide or local systems |
| 881 |
|
administrator to determine the exact location of the MPI libraries. |
| 882 |
|
If libraries are not installed, MPI implementations and related |
| 883 |
|
tools are available including: |
| 884 |
|
\begin{itemize} |
| 885 |
|
\item \begin{rawhtml} <A |
| 886 |
|
href="http://www-unix.mcs.anl.gov/mpi/mpich/"> |
| 887 |
|
\end{rawhtml} |
| 888 |
|
MPICH |
| 889 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 890 |
|
|
| 891 |
|
\item \begin{rawhtml} <A |
| 892 |
|
href="http://www.lam-mpi.org/"> |
| 893 |
|
\end{rawhtml} |
| 894 |
|
LAM/MPI |
| 895 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 896 |
|
|
| 897 |
|
\item \begin{rawhtml} <A |
| 898 |
|
href="http://www.osc.edu/~pw/mpiexec/"> |
| 899 |
|
\end{rawhtml} |
| 900 |
|
MPIexec |
| 901 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 902 |
|
\end{itemize} |
| 903 |
|
|
| 904 |
|
\item Build the code with the \texttt{genmake2} \texttt{-mpi} option |
| 905 |
|
(see Section \ref{sect:genmake}) using commands such as: |
| 906 |
|
{\footnotesize \begin{verbatim} |
| 907 |
|
% ../../../tools/genmake2 -mods=../code -mpi -of=YOUR_OPTFILE |
| 908 |
|
% make depend |
| 909 |
|
% make |
| 910 |
|
\end{verbatim} } |
| 911 |
|
|
| 912 |
|
\item Run the code with the appropriate MPI ``run'' or ``exec'' |
| 913 |
|
program provided with your particular implementation of MPI. |
| 914 |
|
Typical MPI packages such as MPICH will use something like: |
| 915 |
|
\begin{verbatim} |
| 916 |
|
% mpirun -np 4 -machinefile mf ./mitgcmuv |
| 917 |
|
\end{verbatim} |
| 918 |
|
Sightly more complicated scripts may be needed for many machines |
| 919 |
|
since execution of the code may be controlled by both the MPI |
| 920 |
|
library and a job scheduling and queueing system such as PBS, |
| 921 |
|
LoadLeveller, Condor, or any of a number of similar tools. |
| 922 |
|
|
| 923 |
|
\end{enumerate} |
| 924 |
|
|
| 925 |
|
|
| 926 |
|
|
| 927 |
\section{Running the model} |
\section{Running the model} |
| 928 |
\label{sect:runModel} |
\label{sect:runModel} |
| 929 |
|
|
| 930 |
If compilation finished succesfuully (section \ref{sect:buildModel}) |
If compilation finished succesfuully (section \ref{sect:buildingCode}) |
| 931 |
then an executable called {\em mitgcmuv} will now exist in the local |
then an executable called \texttt{mitgcmuv} will now exist in the |
| 932 |
directory. |
local directory. |
| 933 |
|
|
| 934 |
To run the model as a single process (ie. not in parallel) simply |
To run the model as a single process (ie. not in parallel) simply |
| 935 |
type: |
type: |