Commit 340ad476 by Zoltan Karsa

attributes

parent 6f7ac3f5
...@@ -12,10 +12,10 @@ fun = ep_pontok_module.get_function(kers[0]) ...@@ -12,10 +12,10 @@ fun = ep_pontok_module.get_function(kers[0])
def start_kernel(Cx, Cy, Dx, Dy, Dz, v, w): def start_kernel(Cx, Cy, Dx, Dy, Dz, v, w):
print(f"Cnt: {Cx.size}x{Dx.size}={Cx.size*Dx.size}") print(f"Cnt: {Cx.size}x{Dx.size}={Cx.size*Dx.size}")
print("Res size (byte): ", Cx.size*Dx.size*4*4) print("Res size (byte): ", Cx.size*Dx.size*4*4)
print(fun.attributes)
lcm = compute_lcm(Cx.size, Dx.size) lcm = compute_lcm(Cx.size, Dx.size)
#print(Cx.size, ",", Cy.size, ",", Dx.size, ",", Dy.size, ",", Dz.size)
egyensulyi_mtx = cp.zeros((Cx.size*Dx.size, 4, 4), dtype=cp.int8) egyensulyi_mtx = cp.zeros((Cx.size*Dx.size, 4, 4), dtype=cp.int8)
numBlock = int((Cx.size*Dx.size + 256 - 1) / 256) numBlock = int((Cx.size*Dx.size + fun.max_threads_per_block - 1) / fun.max_threads_per_block)
fun((numBlock,), (256,), (v, w, Cx, Cy, Dx, Dy, Dz, Cx.size, Dx.size, lcm, egyensulyi_mtx)) fun((numBlock,), (fun.max_threads_per_block,), (v, w, Cx, Cy, Dx, Dy, Dz, Cx.size, Dx.size, lcm, egyensulyi_mtx))
return egyensulyi_mtx return egyensulyi_mtx
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
#SBATCH --gres gpu # melyik partícióból #SBATCH --gres gpu # melyik partícióból
#SBATCH --time=99:00:00 # maximális id?~Q #SBATCH --time=99:00:00 # maximális id?~Q
#SBATCH -o politopok.out # kimeneti fájl #SBATCH -o politopok.out # kimeneti fájl
#SBATCH --memory=0 #SBATCH --mem=0
module load anaconda3 module load anaconda3
module load cuda11.0 module load cuda11.0
module load mpi-3.1
srun python tetrarun.py -n 51 -v 50 -w 50 -o /gv0/karsa/poli_51_50_50.out srun python tetrarun.py -n 51 -v 50 -w 50 -o /gv0/karsa/poli_51_50_50.out
\ No newline at end of file
...@@ -5,6 +5,7 @@ import os ...@@ -5,6 +5,7 @@ import os
from genax import gen_angels_to_pick, angles_alap, angles_ratet from genax import gen_angels_to_pick, angles_alap, angles_ratet
from gpu import start_kernel from gpu import start_kernel
from utils import convert, printresults, search, exact_one, exact_one_gpu, filter_gpu, writetofile, writetofile2 from utils import convert, printresults, search, exact_one, exact_one_gpu, filter_gpu, writetofile, writetofile2
from mpi import size, rank
def main(argv): def main(argv):
outputfile = None outputfile = None
...@@ -61,25 +62,26 @@ def main(argv): ...@@ -61,25 +62,26 @@ def main(argv):
Dz_cpu = np.zeros(Dz.size, dtype=np.float64) Dz_cpu = np.zeros(Dz.size, dtype=np.float64)
Dz.get(out=Dz_cpu) Dz.get(out=Dz_cpu)
del space
res = start_kernel(Cx, Cy, Dx, Dy, Dz, v, w) res = start_kernel(Cx, Cy, Dx, Dy, Dz, v, w)
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:
offset = ''
if mpi:
offset = f"R{rank}/{size}"
res = start_kernel(Cx, Cy, Dx, Dy, Dz, v, w) res = start_kernel(Cx, Cy, Dx, Dy, Dz, v, w)
os.mkdir(outputfile) os.mkdir(outputfile)
cp.save(outputfile+'/Cx.npy', Cx) cp.save(f"{outputfile}/{offset}_Cx.npy", Cx)
cp.save(outputfile+'/Cy.npy', Cy) cp.save(f"{outputfile}/{offset}_Cy.npy", Cy)
cp.save(outputfile+'/Dx.npy', Dx) cp.save(f"{outputfile}/{offset}_Dx.npy", Dx)
cp.save(outputfile+'/Dy.npy', Dy) cp.save(f"{outputfile}/{offset}_Dy.npy", Dy)
cp.save(outputfile+'/Dz.npy', Dz) cp.save(f"{outputfile}/{offset}_Dz.npy", Dz)
cp.save(outputfile+'/mtx.npy', res) cp.save(f"{outputfile}/{offset}_mtx.npy", res)
#printresults(res) #printresults(res)
#print("Exact one 3-3") #print("Exact one 3-3")
......
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