Klastr je sestaven z relativně homogenní změti následujích počítačů:
Sofwarové vybavení
% mpif90 jméno_programu
Samozřejmě lze připojit libovolné volby pro Intel Fortran (např. -O3 pro optimalizovaný kód nebo -openmp pokud chcete použít i více vláken na jeden stroj). Zkuste si to na příkladu.
% mpirun -x LD_LIBRARY_PATH -np počet_procesů -hostfile jméno_souboru nice -n 10 jméno_programu
kde jméno_souboru je ten, co obsahuje seznam počítačů, na kterých má úloha běžet.
Setting up password-less ssh to the networked Linux workstations is done by first generating an authentication key on the host you intend to run the code from:
% ssh-keygen -t rsa
During this procedure you will be prompted for a passphrase - just hit return at that step (which corresponds to having no passphrase). After you have done this you need to ssh the contents of the file "~/.ssh/id_rsa.pub" created by the previous command to one of the networked Linux machines you wish to use. For example, execute:
% cat ~/.ssh/id_rsa.pub | ssh user@machine2 'cat >> .ssh/authorized_keys'
where "user" is your username, and "machine2" is one of the other workstations. If the file "~/.ssh/authorized_keys" doesn't exist, you will need to create it.
You should then try connecting via ssh to each of the workstations you wish to use. The first time you ssh, you will be asked if you want to continue connecting. Type "yes" at this prompt. Subsequent ssh connections should occur without this step (and without requiring a passwords).
!
! Ukazka kombinace MPI a MP "Ahoj katedro" ve Fortranu 90
!
program main
use mpi
use omp_lib
implicit none
integer :: ierr, rank, sizerank, thread,sizethread
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, sizerank, ierr)
!$OMP PARALLEL PRIVATE(thread,sizethread)
thread = OMP_GET_THREAD_NUM()
sizethread = OMP_GET_NUM_THREADS()
write(*,'(A26,I3,A3,I3,A8,I3,A3,I3)') "Ahoj katedro. Jsem proces ", rank+1, " / ", sizerank, " vlakno ", thread+1," / ",sizethread
!$OMP END PARALLEL
call MPI_FINALIZE(ierr)
end