How to scatter/send all possible column pairs to the child processes and find coherence between the columns using python mpi4py? Parallel computation

26 views
Skip to first unread message

S Alam

unread,
Nov 24, 2021, 2:59:10 PM11/24/21
to mpi...@googlegroups.com

I've a big matrix/2D array for which every possible column-pair I need to find the coherence by parallel computation in python (e.g. mpi4py). Coherence [a function] are computed at various child processes and the child process should send the coherence value to the parent process that gather the coherence value as a list. To do this, I've created a small matrix and list of all possible column pairs as follows:

 

import numpy as np
from scipy import signal
from itertools import combinations
from mpi4py import MPI
 
 
comm = MPI.COMM_WORLD
nproc = comm.Get_size()
rank = comm.Get_rank()
 
data=np.arange(20).reshape(5, 4)
#List of all possible column pairs
data_col = list(combinations(np.transpose(data), 2)) #list
 
# Function creation
def myFunc(X,Y):
..................
..................
    return Real_coh
 
if rank==0:
    Data= comm.scatter(data_col,root=0) #col_pair
 
 

Can anyone suggest me how to proceed further. You are welcome to ask any questions/clarifications. Expecting your cordial help. Thanks

 

Sent from Mail for Windows

 

Reply all
Reply to author
Forward
0 new messages