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
Commit
694ebe1b
authored
Feb 17, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
340ad476
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
epgpu.cu
+2
-0
gpu.py
+1
-0
measure3.sh
+5
-5
tetrarun.py
+2
-2
No files found.
epgpu.cu
View file @
694ebe1b
...
...
@@ -263,6 +263,8 @@ __global__ void gpu_egyensulyi(int v, int w, const double* Cx_arr, const double
int pos = blockDim.x * blockIdx.x + threadIdx.x;
if (pos >= size_C*size_D)
return;
if (pos == 0)
printf("%d", size_C*size_D);
vec3 C(Cx_arr[pos % size_C], Cy_arr[pos % size_C], 0.0);
vec3 D(Dx_arr[(pos + pos / lcm) % size_D], Dy_arr[(pos + pos / lcm) % size_D], Dz_arr[(pos + pos / lcm) % size_D]);
...
...
gpu.py
View file @
694ebe1b
...
...
@@ -16,6 +16,7 @@ def start_kernel(Cx, Cy, Dx, Dy, Dz, v, w):
lcm
=
compute_lcm
(
Cx
.
size
,
Dx
.
size
)
egyensulyi_mtx
=
cp
.
zeros
((
Cx
.
size
*
Dx
.
size
,
4
,
4
),
dtype
=
cp
.
int8
)
numBlock
=
int
((
Cx
.
size
*
Dx
.
size
+
fun
.
max_threads_per_block
-
1
)
/
fun
.
max_threads_per_block
)
print
(
f
"{Cx.size}, {Cy.size}, {Dx.size}, {Dy.size}, {Dz.size}, {egyensulyi_mtx.shape}, {egyensulyi_mtx.nbytes}"
)
fun
((
numBlock
,),
(
fun
.
max_threads_per_block
,),
(
v
,
w
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
Cx
.
size
,
Dx
.
size
,
lcm
,
egyensulyi_mtx
))
return
egyensulyi_mtx
measure3.sh
View file @
694ebe1b
#!/bin/bash
#SBATCH --job-name=gpgpu # a job neve
#SBATCH -N
1
# hány node-ot szeretnénk használni
#SBATCH -N
4
# hány node-ot szeretnénk használni
#SBATCH -p gpu # melyik partícióból
#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 -o politopok.out
# kimeneti fájl
#SBATCH -o politopok.out # kimeneti fájl
#SBATCH --mem=0
module load anaconda3
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
\ No newline at end of file
mpirun 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 @
694ebe1b
...
...
@@ -68,12 +68,12 @@ def main(argv):
res
.
get
(
out
=
mtx_cpu
)
#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
:
offset
=
''
if
mpi
:
offset
=
f
"R{rank}
/
{size}"
offset
=
f
"R{rank}
-
{size}"
res
=
start_kernel
(
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
v
,
w
)
os
.
mkdir
(
outputfile
)
cp
.
save
(
f
"{outputfile}/{offset}_Cx.npy"
,
Cx
)
...
...
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