asum= PyPBLAS.pvasum(x)
La función "PyPBLAS.pvasum" calcula la suma de los valores absolutos del
vector x, siendo el vector x una variable de tipo PyACTS conteniendo
un vector en su campo de datos.
Parametros de Entrada
Parametros de Salida
x.
from PyACTS import *
import PyPBLAS
from RandomArray import *
from Numeric import *
#Dimension of Arrays
n=8
#Initiliaze the Grid
PyACTS.gridinit()
if PyACTS.iread==1:
print "Example of using PyPBLAS: PvASUM"
print "Parameters:N=",n,";Grid:",PyACTS.nprow,"*",PyACTS.npcol
print "Block's size:",PyACTS.mb,"*",PyACTS.nb
x=(2+1j)*ones([n,1])
print "x'=",transpose(x)
else:
x=None
#We convert Numeric Array to PyACTS.Scalapack Array
ACTS_lib=1 # 1=Scalapack
x=Num2PyACTS(x,ACTS_lib)
#We call PyPblas Routine
asum = PyPBLAS.pvasum(x)
if PyACTS.iread==1:
print "PvASUM=",asum
PyACTS.gridexit()
[vgaliano@localhost EXAMPLES]$ mpirun -np 4 mpipython exPypvasum.py
Example of using PyPBLAS: PvASUM
Parameters:N= 8 ;Grid: 2 * 2
Block's size: 2 * 2
x'= [ [ 2.+1.j 2.+1.j 2.+1.j 2.+1.j 2.+1.j 2.+1.j 2.+1.j
2.+1.j]]
PvASUM= (24+0j)
See Sobre este documento... para sugerencias en cambios.