‘’
Doing some process
‘’
for neighbor in self.Nin:
if self.COMM.Iprobe(source= neighbor+1, tag= (self.n_variables) + self.shift_in[neighbor]**(self.n_variables) + 2):
VV = []
rrho = []
for i in range(self.n_variables):
data1 = np.zeros(self.Z[i].shape , dtype='float32') + 1e-12
self.COMM.Irecv([data1, MPI.FLOAT], source= neighbor+1, tag= ((i+1) + self.shift_in[neighbor]**(i+1) + 1)).wait()
VV.append(tf.Variable(data1))
del data1
data2 = np.zeros(self.Z[i].shape, dtype='float32') + 1e-12
self.COMM.Irecv([data2, MPI.FLOAT], source= neighbor+1, tag= (i+1) + self.shift_in[neighbor]**(i+1) + 2).wait()
rrho.append(tf.Variable(data2))
del data2
‘’
Doing some other process
‘’
else:
‘’
Doing some process
‘’
‘’
Doing some process
‘’
for neighbor in self.Nout:
for i in range(self.n_variables):
data1 = np.array([…])
data2 = np.array([…])
self.COMM.Isend([data1, MPI.FLOAT], dest= neighbor+1, tag= ((i+1) + self.shift_out[neighbor]**(i+1) + 1))
self.COMM.Isend([data2, MPI.FLOAT], dest= neighbor+1, tag= ((i+1) + self.shift_out[neighbor]**(i+1) + 2))
[acesgpu-SYS-7048GR-TR:42345] Read -1, expected 18446744073709547520, errno = 22
A process has executed an operation involving a call to the
"fork()" system call to create a child process. Open MPI is currently
operating in a condition that could result in memory corruption or
other system errors; your job may hang, crash, or produce silent
data corruption. The use of fork() (or system() or other calls that
create child processes) is strongly discouraged.
The process that invoked fork was:
Local host: [[44768,1],2] (PID 200246)
If you are *absolutely sure* that your application will successfully
and correctly survive a call to fork(), you may disable this warning
by setting the mpi_warn_on_fork MCA parameter to 0.
--
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/ac63e4bb-d2b3-49a1-b179-57777cda1036o%40googlegroups.com.
COMM = MPI.COMM_WORLD
SIZE = COMM.Get_size()
RANK = COMM.Get_rank()
name = RANK
Nout = [1, 3, 5]
Nin = [2, 0, 4]
n_variables = 6
shift_out = {i:(i+1) for i in Nout}
shift_in = {i:(name+1) for i in Nin}
trainable_variables = [tf.Variable(
np.zeros(
(3, 3, 1, 32)
, dtype='float32')
), tf.Variable(
np.zeros(
(32,)
, dtype='float32'))
,
tf.Variable(np.zeros(
(21632, 128)
, dtype='float32')
), tf.Variable(
np.zeros(
(128,)
, dtype='float32')
), tf.Variable(
np.zeros(
(128, 10)
, dtype='float32')
),
tf.Variable(np.zeros(
(10,)
, dtype='float32')
) ]
send_buff_rho = {j:[[np.zeros(
trainable_variables[i]
.shape , dtype='float32') + 1e-15 for i in range(n_variables)] for _ in range(30)] for j in Nout}
send_buff_V = {j:[[np.zeros(
trainable_variables[i]
.shape
, dtype='float32') + 1e-15 for i in range(n_variables)] for _ in range(30)] for j in Nout}
send_ind = 0
‘’
Doing some process
‘’
for neighbor in Nin:
if COMM.Iprobe(source= neighbor, tag= (n_variables) + shift_in[neighbor]**(n_variables) + 2):
VV = []
rrho = []
for i in range(n_variables):
data1 = np.zeros(trainable_variables[i].shape , dtype='float32') + 1e-12
COMM.Irecv([data1, MPI.FLOAT], source= neighbor, tag= ((i+1) + shift_in[neighbor]**(i+1) + 1)).Wait()
VV.append(tf.Variable(data1))
del data1
data2 = np.zeros(trainable_variables[i].shape
, dtype='float32') + 1e-12
COMM.Irecv([data2, MPI.FLOAT], source= neighbor, tag= (i+1) + shift_in[neighbor]**(i+1) + 2).Wait()
rrho.append(tf.Variable(data2))
del data2
‘’
Doing some other process
‘’
else:
‘’
Doing some process
‘’
‘’
Doing some process
‘’
for neighbor in Nout:
temp1 = []
temp2 = []
for i in range(n_variables):
data1 = np.random.randn(trainable_variables[i].shape, dtype=
'float32'
)
data2 = np.random.randn(trainable_variables[i].shape, dtype=
'float32'
)
temp1.append(data1)
temp2.append(data2)
if np.mod(send_ind, 30) == 0.0:
send_ind = 0
send_buff_V[neighbor][self.send_ind] = temp1
send_buff_rho[neighbor][self.send_ind] = temp2
del temp1
del temp2
del data1
del data2
COMM.Isend([send_buff_V[neighbor][-1][i], MPI.FLOAT], dest= neighbor, tag= ((i+1) + shift_out[neighbor]**(i+1) + 1))
COMM.Isend([send_buff_rho[neighbor][-1][i], MPI.FLOAT], dest= neighbor, tag= ((i+1) + shift_out[neighbor]**(i+1) + 2))
[acesgpu-SYS-7048GR-TR:42345] Read -1, expected 18446744073709547520, errno = 22
To unsubscribe from this group and stop receiving emails from it, send an email to mpi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/ac63e4bb-d2b3-49a1-b179-57777cda1036o%40googlegroups.com.
Hi Lisandro,I am very thankful for your time and help. And My apologies for the code and any inconvenience. I have written an executable code using mpi4py, numpy, time. The code has been attached on this message (main.py). I am using 6 processors for the code (mpiexec -np 6 python main.py)
Well, my experience using MPI is not too much and previously I was working more with the blocking communications.
The main point we're trying to implement is the asynchronous sending and receiving. Each processors need to send messages and continue doing their work. And each processors should receive the messages from the other specified processors once it's available and delivered (if the message has not been delivered yet, it should not wait for the message to become available). [Using MPI.Request.Waitall(list_of_requests) pauses the processor until the communication is done and we don't want to do that]. [and send-to-self calls is not intended]
for i=1:100
do some work
if message from other processor is available:
receive message
else:
do some work
do some work
sending message to other processors
--
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/340546c2-1f8c-4453-bb4a-8ffd9ce59acbo%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/340546c2-1f8c-4453-bb4a-8ffd9ce59acbo%40googlegroups.com.