Login/Compile
Login
Hostname: kagayaki
% ssh kagayaki -l <UserID>
Environment setting
Changing the used compiler and linking the library are done by loading the necessary modules.
1. Display a list of loaded modules.
% module list
2. Check available modules
% module avail
3. Load/unload modules
% module load/unload <module name>
4. Unload all loaded modules
% module purge
例1. Intel Compiler(OneAPI) + Intel MPI + Intel MKL
% module load oneapi-intel/2021.1.1
例2.Intel Compiler(OneAPI) + OpenMPI + Intel MKL
% module load openmpi/4.1.1/intel
% module load compiler/2021.1.1
% module load mkl/2021.1.1
例3. GNU Compiler + OpenMPI + FFTW3
% module load openmpi/4.1.1/gcc
% module load fftw/3.3.9
Howto Compile
Ex1. Intel Compiler(OneAPI) + Intel MPI + Intel MKL
% module load oneapi-intel/2021.1.1
% mpiicc -O3 -o prog.exe prog.c (# MPI only)
% mpiicc -O3 -o prog.exe -qopenmp prog.c ( #MPI+OpenMP Hybrid)
Ex2.Intel Compiler(OneAPI) + OpenMPI + Intel MKL
% module load openmpi/4.1.1/intel
% module load compiler/2021.1.1
% module load mkl/2021.1.1
% mpicc -O3 -o prog.exe prog.c (# MPI only)
% mpicc -O3 -o prog.exe -qopenmp prog.c ( #MPI+OpenMP Hybrid)
Ex3. GNU Compiler + OpenMPI + FFTW3
% module load openmpi/4.1.1/gcc
% module load fftw/3.3.9
% mpicc -O3 -o prog.exe prog.c (# MPI only)
% mpicc -O3 -o prog.exe -fopenmp prog.c ( #MPI+OpenMP Hybrid)
Ex4. Intel Compiler(OneAPI) + Intel MPI + Intel MKL
% module load oneapi-intel/2021.1.1
% mpiicc -O3 -o prog.exe -qopenmp prog.c -L${MKLROOT}/lib/intel64 -liomp5 -lpthread -lm -ldl -mkl=sequential ( #MPI+OpenMP Hybrid)
* For detail of MKL, please refer to Intel Link Line Advisor.
Complie
Compiler | Fortran | C | C++ | Command |
---|---|---|---|---|
GNU | g77,gfortran | cc | g++ | |
Intel Compiler | ifort | icc | icpc | |
LVMM | flang | clang | clang++ |
Compiler | Fortran | C | C++ | Command |
---|---|---|---|---|
Intel MPI | mpiifort | mpiicc | mpiicpc | |
OpenMPI | mpif90 | mpicc | mpicxx |
Serial Program:
% cc -O3 -o comp.exe comp.c
OpenMPI(GCC) Program:
% module load openmpi/4.1.0/gcc
% mpicc -O3 -o comp.exe comp.c
OpenMP thread Program:
% cc -O3 -fopenmp -o comp.exe comp.c
OpenMPI(GCC)+OpenMP Hybrid Program:
% module load openmpi/4.1.0/gcc
% mpicc -O3 -fopenmp -o comp.exe comp.c