# Inverse Matrix python3 mpi4py EOFError

Can you help me with this error? Why is that error here? I'm calculating the inverse of matrix.

Here is code:

import numpy as np

from [url removed, login to view] import inv

from [url removed, login to view] import det

from mpi4py import MPI

comm = MPI.COMM_WORLD

rank = comm.Get_rank()

size = comm.Get_size()

m = input("Enter number of rows, m = \n")

n = input("Enter number of columns, n = \n")

if rank==0:

matrix = [url removed, login to view]((m,n))

determinant = [url removed, login to view]((2))

for i in range (0,m):

for j in range(0,n):

print("Enter the value for the field: m = ", i+1, ", n = ", j+1,"\n")

matrix[i][j] = float(input())

[url removed, login to view](matrix, dest=1, tag=0)

[url removed, login to view](matrix, dest=2, tag=0)

[url removed, login to view](determinant, source=1, tag=0)

[url removed, login to view](matrix, source=2, tag=0)

if(determinant[0]==0):

print("There is no inverse matrix since the determinant is 0!")

else:

print("Inverse matrix:\n",matrix)

elif rank==1:

matrix = [url removed, login to view]((m,n))

determinant = [url removed, login to view]((2))

[url removed, login to view](matrix, source=0, tag=0)

determinant = [url removed, login to view]([[det(matrix)],[0]])

[url removed, login to view](determinant, dest=0)

elif rank==2:

matrix = [url removed, login to view]((m,n))

[url removed, login to view](matrix, source=0, tag=0)

matrix = inv(matrix)

[url removed, login to view](matrix, dest=0)

else:

exit()

Taidot: Matematiikka, Python

Tietoa työnantajasta:
( 1 arvostelu ) Motovun, Croatia

Projektin tunnus: #15156002

## 8 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön

\$111 USD 1 päivässä
(40 arvostelua)
6.4
\$25 USD 1 päivässä
(34 arvostelua)
4.8
Valuesolutions

Hello, how are you? I hope you have a bright day/evening from your side. I have read the details provided, but please contact me so that we can discuss more on the project. Stay tuned, I'm still working on this propo Lisää

\$54 USD 1 päivässä
(8 arvostelua)
4.2
gr8tech

\$25 USD 1 päivässä
(19 arvostelua)
3.6
\$25 USD 1 päivässä
(0 arvostelua)
0.0
rahimdaud

I made such codes in my beginning days in Engineering. Accept the Bid and we can discuss the code further and this code can be modified as well for better performance

\$30 USD 1 päivässä
(0 arvostelua)
0.0
apoorvkalra29

A proposal has not yet been provided

\$25 USD 1 päivässä
(0 arvostelua)
0.0
vodelarakesh

A proposal has not yet been provided

\$25 USD 1 päivässä
(0 arvostelua)
0.0