ВУЗ:
Рубрика:
151
Call VecAssemblyBegin(x, ierr)
Call VecAssemblyEnd(x, ierr)
v=3.0
Call VecSet(y, v, ierr)
Call VecNorm(x, NORM_2, r, ierr)
if (rank .eq. 0) write (*,*) 'r=',r
Call VecAXPY(y, r, x, ierr)
if (rank .eq. 0) write (*,*) 'Vector X'
Call VecView(x, PETSC_VIEWER_STDOUT_WORLD, ierr)
if (rank .eq. 0) write (*,*) 'Vector Y'
Call VecView(y, PETSC_VIEWER_STDOUT_WORLD, ierr)
Call VecDestroy(x, ierr)
Call VecDestroy(y, ierr)
Call PetscFinalize(ierr)
end
После запуска программы на 4 процессорах
mpirun -np 4 ./ex1.exe
получим
r= 16.881943
Vector X
Process [0]
0
1
2
Process [1]
3
4
5
Process [2]
6
7
Process [3]
8
9
Vector Y
Process [0]
3
19.8819
Страницы
- « первая
- ‹ предыдущая
- …
- 149
- 150
- 151
- 152
- 153
- …
- следующая ›
- последняя »
