Commit e7863ff4 authored by Vigeesh Gangadharan's avatar Vigeesh Gangadharan
Browse files

free commincator works, try return

parent b4cd05c0
......@@ -247,47 +247,44 @@ def vfisv(
progress = np.zeros(shape=(1), dtype="int32")
common_comm.Recv([progress, MPI.INT], source=MPI.ANY_SOURCE, tag=4000 + i)
print('Completed inversions')
# receive the inversion result from grisinv:master
data = np.zeros(
shape=(vfisv_data.LX, vfisv_data.LY, vfisv_data.LZ),
dtype="float32",
order="F",
)
print('1.')
common_comm.Recv([data, MPI.FLOAT], source=1, tag=4000)
# TODO: Clean this part
# Get the fits
print('2.')
sifit = np.zeros_like(vfisv_data.SI)
common_comm.Recv([sifit, MPI.FLOAT], source=1, tag=6660)
print('3.')
sqfit = np.zeros_like(vfisv_data.SQ)
common_comm.Recv([sqfit, MPI.FLOAT], source=1, tag=6661)
print('4.')
sufit = np.zeros_like(vfisv_data.SU)
common_comm.Recv([sufit, MPI.FLOAT], source=1, tag=6662)
print('5.')
svfit = np.zeros_like(vfisv_data.SV)
common_comm.Recv([svfit, MPI.FLOAT], source=1, tag=6663)
print('6. Disconnecting intercommunicator')
# disengage vifisv:master+slaves
common_comm.Free()
print('7. Disconnecting intracommunicator')
pycomm.Free()
print('Disconnected')
pycomm.Free()
# TODO: Clean this
# arrange data for output into maps.
inv_data, stokes_data = process_vfisv_output(
data, sifit, sqfit, sufit, svfit, vfisv_data
)
print('Output processesd')
# change the vfisv_data to a header list here and pass the header for return
header = make_header(vfisv_data)
print('returning data')
return inv_data, stokes_data, header
......@@ -756,6 +753,7 @@ def write_fits(data, header, out, errors=None):
errors, overwrite=True, output_verify="silentfix+exception", checksum=True
)
print('Return after Dones')
return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment