Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
en:documentation:tutorials:build:fortran_parallele [2018/11/20 10:55] – créée cicaluga | en:documentation:tutorials:build:fortran_parallele [2023/12/12 13:00] (Version actuelle) – supprimée ltaulell | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Compilation and execution of a program (Fortran 90) ====== | ||
- | |||
- | ===== Fortran 90 language, parallel code (MPI) ===== | ||
- | |||
- | The program [[documentation: | ||
- | |||
- | ==== Compilation of a program : ==== | ||
- | |||
- | === Definition of the environment : : === | ||
- | |||
- | * definition of the environment : | ||
- | <code bash> | ||
- | module avail | ||
- | module load GCC/ | ||
- | </ | ||
- | |||
- | |||
- | * checking | ||
- | < | ||
- | mpifort -showme | ||
- | |||
- | gfortran ..... | ||
- | </ | ||
- | |||
- | === Compilation : === | ||
- | |||
- | |||
- | < | ||
- | mpifort -o SommeVecVecPAR.exe SommeVecVecPAR.f90 | ||
- | </ | ||
- | |||
- | |||
- | The binary file (executable) SommeVecVecPAR.exe has been generated. | ||
- | |||
- | ====Execution of the program: | ||
- | |||
- | === Running on the build server: === | ||
- | |||
- | < | ||
- | mpirun -np 2 ./ | ||
- | </ | ||
- | |||
- | The result is displayed on the screen: | ||
- | |||
- | < | ||
- | LES DEUX VECTEURS : | ||
- | A = 1 | ||
- | B = 9 | ||
- | |||
- | LES DEUX VECTEURS LOCAUX : | ||
- | Je suis le proc 0 parmi 2 processus | ||
- | A local ( proc 0 ) = 1 | ||
- | B local ( proc 0 ) = 9 | ||
- | Je suis le proc 1 parmi 2 processus | ||
- | A local ( proc 1 ) = 6 | ||
- | B local ( proc 1 ) = 4 | ||
- | LE VECTEUR SOMME LOCAL : | ||
- | C local ( proc 1 ) = | ||
- | C local ( proc 0 ) = | ||
- | LE VECTEUR SOMME : | ||
- | C = | ||
- | </ | ||
- | |||
- | === Running on the cluster: === | ||
- | |||
- | |||
- | We use a submission script [[http:// | ||
- | |||
- | |||
- | It is the submission script that configures the environment and then calls your binary (with its options, if any) on the execution node. | ||
- | |||
- | '' | ||
- | |||
- | < | ||
- | qsub batch.sh | ||
- | Your job 336000 (" | ||
- | </ | ||
- | |||
- | < | ||
- | qstat | ||
- | |||
- | job-ID | ||
- | ----------------------------------------------------------------------------------------------------------------- | ||
- | 336000 0.00000 SommeVecVecPAR | ||
- | |||
- | qstat | ||
- | |||
- | job-ID | ||
- | ----------------------------------------------------------------------------------------------------------------- | ||
- | 336000 0.05000 SommeVecVecPAR | ||
- | </ | ||
- | |||
- | The output of the screen (standard output) is redirected to the file '' | ||
- | The error output (standard error) is redirected to the file '' | ||
- | |||
- | < | ||
- | cat SommeVecVecPAR.o336000 | ||
- | |||
- | / | ||
- | LES DEUX VECTEURS : | ||
- | A = 1 | ||
- | B = 9 | ||
- | LES DEUX VECTEURS LOCAUX : | ||
- | Je suis le proc 0 parmi 2 processus | ||
- | A local ( proc 0 ) = 1 | ||
- | B local ( proc 0 ) = 9 | ||
- | LE VECTEUR SOMME LOCAL : | ||
- | C local ( proc 0 ) = | ||
- | LE VECTEUR SOMME : | ||
- | C = | ||
- | Je suis le proc 1 parmi 2 processus | ||
- | A local ( proc 1 ) = 6 | ||
- | B local ( proc 1 ) = 4 | ||
- | C local ( proc 1 ) = | ||
- | </ |