Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Karsa Zoltán István
/
politopok
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
340ad476
authored
Feb 14, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attributes
parent
6f7ac3f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
gpu.py
+3
-3
measure3.sh
+4
-1
tetrarun.py
+11
-9
No files found.
gpu.py
View file @
340ad476
...
@@ -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
measure3.sh
View file @
340ad476
...
@@ -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
tetrarun.py
View file @
340ad476
...
@@ -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")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment