Login・Compile
Login
Hostname: lmpcc
% ssh lmpcc -l <UserID>
Environment setting
The default environment (Intel + HPE_MPT) is set at login. 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. Replacing modules
% module swap <module name before> <module name after>
Complie
Compiler | Fortran | C | C++ | Command |
---|---|---|---|---|
GCC | g77,gfortran | cc | g++ | |
Intel Compiler | ifort | icc | icpc | |
PGI Compiler | pgf90 | pgcc | pgCC |
|
Serial Program ( without MPI, thread parallelization)
% icc -O3 -o comp.exe comp.c
MPI Program
% icc -O3 -o comp.exe comp.c -lmpi
OpenMP Program
% icc -O3 -qopenmp -o comp.exe comp.c
MPI+OpenMP Hybrid
% icc -O3 -qopenmp -o comp.exe comp.c -lmpi
Compiler Option(intel)
-mcmodel
Tells the compiler to use a specific memory model to generate code and store data.
(default: small)
Example)icc -O3 -mcmodel=medium -shared-intel -o sample.exe sample.c
This option tells the compiler to use a specific memory model to generate code and store data. It can affect code size and performance. If your program has global and static data with a total size smaller than 2GB, -mcmodel=small is sufficient. Global and static data larger than 2GB requires-mcmodel=medium or -mcmodel=large. Allocation of memory larger than 2GB can be done with any setting of -mcmodel.
引数 | |
---|---|
small | Tells the compiler to restrict code and data to the first 2GB of address space. All accesses of code and data can be done with Instruction Pointer (IP)-relative addressing. |
medium | Tells the compiler to restrict code to the first 2GB; it places no memory restriction on data. Accesses of code can be done with IP-relative addressing, but accesses of data must be done with absolute addressing. |
large | Places no memory restriction on code or data. All accesses of code and data must be done with absolute addressing. |
Notice) When you specify option -mcmodel=medium or -mcmodel=large, it sets option -shared-intel. This ensures that the correct dynamic versions of the Intel run-time libraries are used.