forked from PDC-support/introduction-to-pdc-retired
-
Notifications
You must be signed in to change notification settings - Fork 0
/
development.tex
171 lines (151 loc) · 4.69 KB
/
development.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
\section{Development}
\subsection{Building}
\begin{frame}[fragile]
\frametitle{Compiling, Linking and Running Applications}
\framesubtitle{on HPC clusters}
\begin{description}
\item [source code] C / C++ / Fortran ( \verb|.c, .cpp, .f90, .h| )
\item [compile] Cray/Intel/GNU compilers
\item [assemble] into machine code (object files: \verb|.o, .obj| )
\item [link] Static Libraries (\verb|.lib, .a| ) \\ Shared Library (\verb|.dll, .so| ) \\ Executables (\verb|.exe, .x| )
\item ~
\item [request allocation] submit job request to SLURM queuing system \\ \verb|salloc/sbatch|
\item [run] application on scheduled resources \\ \verb|srun/mpirun|
\end{description}
\end{frame}
\subsection{Modules}
\begin{frame}[fragile]
\frametitle{Modules}
\framesubtitle{The \textit{modules package} allow for dynamic add/remove of installed software packages to the running environment}
\begin{exampleblock}{Loading modules}
\begin{verbatim}
module load <software_name>
module add <software_name>
module use <software_name>
\end{verbatim}
\end{exampleblock}
\begin{exampleblock}{Swapping modules}
\begin{verbatim}
module swap <software_name_1> <software_name_2>
\end{verbatim}
\end{exampleblock}
\begin{exampleblock}{Unloading modules}
\begin{verbatim}
module unload <software_name>
\end{verbatim}
\end{exampleblock}
\end{frame}
\begin{frame}[fragile]
\frametitle{Modules }
\framesubtitle{Displaying modules}
\begin{exampleblock}{\$ module list}
\scriptsize
\begin{verbatim}
Currently Loaded Modulefiles:
1) modules/3.2.6.7
...
20) PrgEnv-cray/5.2.56
\end{verbatim}
\end{exampleblock}
\begin{exampleblock}{\$ module avail [\textit{software\_name}]}
\scriptsize
\begin{verbatim}
-------------------------- /opt/modulefiles -----------------------------
gcc/4.8.1 gcc/4.9.1(default) gcc/4.9.2 gcc/4.9.3 gcc/5.1.0
\end{verbatim}
\end{exampleblock}
\begin{exampleblock}{\$ module show \textit{software\_name}}
\scriptsize
\begin{verbatim}
------------------------- /opt/modulefiles/gcc/4.9.1 ---------------------
conflict gcc
prepend-path PATH /opt/gcc/4.9.1/bin
prepend-path MANPATH /opt/gcc/4.9.1/snos/share/man
prepend-path LD_LIBRARY_PATH /opt/gcc/4.9.1/snos/lib64
setenv GCC_PATH /opt/gcc/4.9.1
-------------------------------------------------------------------
\end{verbatim}
\end{exampleblock}
\end{frame}
\subsection{Programming environments}
\begin{frame}[fragile]
\frametitle{Programming Environment Modules}
\framesubtitle{specific to \alert{Beskow}}
\begin{columns}[t]
\column{.7\textwidth}
\begin{description}
\item [Cray] \verb|$ module load PrgEnv-cray|
\item [Intel] \verb|$ module load PrgEnv-intel|
\item [GNU] \verb|$ module load PrgEnv-gnu|
\end{description}
% \item Module cray-libsci provides BLAS, LAPACK, BLACS, and SCALAPACK
% \item Module cray-mpich provides MPI
\column{.3\textwidth}
\begin{verbatim}
$ cc source.c
$ CC source.cpp
$ ftn source.F90
\end{verbatim}
\end{columns}
\begin{exampleblock}{Compiler wrappers : \alert{\textbf{cc} \textbf{CC} \textbf{ftn}}}
\alert{Advantages}\\
Compiler wrappers will automatically
\begin{itemize}
\item link to BLAS, LAPACK, BLACS, SCALAPACK, FFTW\\
\item use MPI wrappers\\
\end{itemize}
\alert{Disadvantage}\\
Sometimes you need to edit Makefiles which are not designed for Cray
\end{exampleblock}
\end{frame}
\subsection{Compilers}
\begin{frame}[fragile]
\frametitle{Compiling serial and/or parallel code}
\framesubtitle{specific to \alert{Tegner}}
\begin{columns}[t]
\column{.45\textwidth}
\begin{exampleblock}{GNU Compiler Collection (\textbf{gcc})}
\scriptsize
\begin{verbatim}
$ module load gcc openmpi
$ gcc -fopenmp source.c
$ g++ -fopenmp source.cpp
$ gfortran -fopenmp source.F90
$ mpicc -fopenmp source.c
$ mpicxx -fopenmp source.cpp
$ mpif90 -fopenmp source.F90
\end{verbatim}
\end{exampleblock}
\begin{exampleblock}{Portland Group Compilers (\textbf{pgi}) }
\scriptsize
\begin{verbatim}
$ module load pgi
$ pgcc -mp source.c
$ pgcpp -mp source.cpp
$ pgf90 -mp source.F90
\end{verbatim}
\end{exampleblock}
\column{.45\textwidth}
\begin{exampleblock}{Intel compilers (\textbf{i-compilers})}
\scriptsize
\begin{verbatim}
$ module load i-compilers
$ icc -openmp source.c
$ icpc -openmp source.cpp
$ ifort -openmp source.F90
$ module load i-compilers intelmpi
$ mpiicc -openmp source.c
$ mpiicpc -openmp source.cpp
$ mpiifort -openmp source.F90
\end{verbatim}
\end{exampleblock}
\begin{exampleblock}{CUDA compilers (\textbf{cuda})}
\scriptsize
\begin{verbatim}
$ module load cuda
$ nvcc source.cu
$ nvcc -arch=sm_37 source.cu
\end{verbatim}
\end{exampleblock}
\end{columns}
\end{frame}