y= PyPBLAS.pvcopy(x)
La función "PyPBLAS.pvcopy" distribuye (si es necesario) y copia el
contenido de un vector x
en otro vector y
. Se ha tener en cuenta que
los parámetros de entrada y salida son de tipo PyACTS.
Los mínimos parametros de entrada de la función son:
Parametros de Entrada
Parametros de Salida
from PyACTS import * import PyACTS.PyPBLAS as 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: PvCOPY" print "N=",n,";nprow x npcol:",PyACTS.nprow,"x",PyACTS.npcol print "Block's size:",PyACTS.mb,"*",PyACTS.nb x=reshape(array(range(n),Float),[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 PBLAS routine y= PyPBLAS.pvcopy(x) if PyACTS.ictxt<>-1: print "x[",PyACTS.myrow,",",PyACTS.mycol,"]=",transpose(x.data) print "y[",PyACTS.myrow,",",PyACTS.mycol,"]=",transpose(y.data) PyACTS.gridexit()
[vgaliano@localhost EXAMPLES]$ mpirun -np 4 mpipython exPypvcopy.py Example of using PyPBLAS: PvCOPY N= 8 ;nprow x npcol: 2 x 2 Block's size: 2 * 2 x= [ [ 0. 1. 2. 3. 4. 5. 6. 7.]] x[ 0 , 0 ]= [ 0. 1. 4. 5.] y[ 0 , 0 ]= [ [ 0. 1. 4. 5.]] x[ 0 , 1 ]= zeros((0,), 'd') y[ 0 , 1 ]= zeros((0, 4), 'f') x[ 1 , 0 ]= [ 2. 3. 6. 7.] y[ 1 , 0 ]= [ [ 2. 3. 6. 7.]] x[ 1 , 1 ]= zeros((0,), 'd') y[ 1 , 1 ]= zeros((0, 4), 'f')