Commit 7e67e85a by Zoltan Karsa

setup filename for mpi

parent 954052f8
...@@ -70,7 +70,7 @@ def main(argv): ...@@ -70,7 +70,7 @@ def main(argv):
mtx_cpu = np.zeros(res.size, dtype=np.int8).reshape(res.shape) mtx_cpu = np.zeros(res.size, dtype=np.int8).reshape(res.shape)
res.get(out=mtx_cpu) res.get(out=mtx_cpu)
#writetofile(outputfile+'.full', Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi) writetofile(outputfile+'.full', Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi)
#writetofile2(outputfile, Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi) #writetofile2(outputfile, Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi)
if outputfile and binary: if outputfile and binary:
......
...@@ -52,7 +52,8 @@ def writetofile(filename, Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi): ...@@ -52,7 +52,8 @@ def writetofile(filename, Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi):
pos = size_C * size_D pos = size_C * size_D
if mpi: if mpi:
filename = f'R{rank}/{size}_' + filename filename = filename + f'R{rank}-{size}.out'
print("Filename: ", filename)
f = open(filename, "w") f = open(filename, "w")
for i in range(0, pos): for i in range(0, pos):
...@@ -77,8 +78,9 @@ def writetofile2(filename, Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi) ...@@ -77,8 +78,9 @@ def writetofile2(filename, Cx_cpu, Cy_cpu, Dx_cpu, Dy_cpu, Dz_cpu, mtx_cpu, mpi)
pos = size_C * size_D pos = size_C * size_D
if mpi: if mpi:
filename = f'R{rank}/{size}_' + filename filename = filename + f'R{rank}-{size}.out'
print("Filename: ", filename)
f = open(filename, "w") f = open(filename, "w")
for i in range(0, pos): for i in range(0, pos):
s = 0 s = 0
......
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 sign in to comment