Skip to content

Commit

Permalink
Merge pull request #2 from ct-clmsn/riscv-rv64g
Browse files Browse the repository at this point in the history
added riscv/rv64g support
  • Loading branch information
diehlpk authored Jun 20, 2023
2 parents 3b495ea + f821afa commit 87e4af1
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 12 deletions.
23 changes: 12 additions & 11 deletions benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@

len=100000000
path=$(pwd)
#25

for i in {25..1}
for i in {4..1}
do
data=""
for j in {1..10}
do
result=$(srun ${path}/build/src/taylor_future ${len} 0.5 $i)
result=$(srun --cpus-per-task=4 --ntasks-per-node=1 --ntasks-per-core=1 ${path}/build/src/taylor_future ${len} 0.5 $i)
array=($result)
IFS=',' read -ra my_array <<< "${array[0]}"
data="$data ${my_array[1]}"
done
list=(`for n in $data; do printf "%015.06f\n" $n; done | sort -n`);
list=(`for n in $data; do printf "%015.06f\n" $n; done | sort -n`)
echo "$i,${list[${#list[*]}/2]},${list[0]},${list[${#list[*]}-1]}" >> $1_taylor_future_median.csv
done

for i in {25..1}
for i in {4..1}
do
data=""
for j in {1..10}
do
result=$(srun ${path}/build/src/taylor_future_hpx ${len} 0.5 $i --hpx:threads=$i)
result=$(srun --cpus-per-task=4 --ntasks-per-node=1 --ntasks-per-core=1 ${path}/build/src/taylor_future_hpx ${len} 0.5 $i --hpx:threads=$i)
array=($result)
IFS=',' read -ra my_array <<< "${array[0]}"
data="$data ${my_array[1]}"
Expand All @@ -31,12 +32,12 @@ do
echo "$i,${list[${#list[*]}/2]},${list[0]},${list[${#list[*]}-1]}" >> $1_taylor_future_hpx_median.csv
done

for i in {25..1}
for i in {4..1}
do
data=""
for j in {1..10}
do
result=$(srun ${path}/build/src/taylor_par_hpx ${len} 0.5 --hpx:threads=$i)
result=$(srun --cpus-per-task=4 --ntasks-per-node=1 --ntasks-per-core=1 ${path}/build/src/taylor_par_hpx ${len} 0.5 --hpx:threads=$i)
array=($result)
IFS=',' read -ra my_array <<< "${array[0]}"
data="$data ${my_array[1]}"
Expand All @@ -45,12 +46,12 @@ do
echo "$i,${list[${#list[*]}/2]},${list[0]},${list[${#list[*]}-1]}" >> $1_taylor_par_hpx_median.csv
done

for i in {1..1}
for i in {4..1}
do
data=""
for j in {1..10}
do
result=$(srun ${path}/build/src/taylor_future_coroutine_hpx ${len} 0.5 $i --hpx:threads=$i)
result=$(srun --cpus-per-task=4 --ntasks-per-node=1 --ntasks-per-core=1 ${path}/build/src/taylor_future_coroutine_hpx ${len} 0.5 $i --hpx:threads=$i)
array=($result)
IFS=',' read -ra my_array <<< "${array[0]}"
data="$data ${my_array[1]}"
Expand All @@ -60,12 +61,12 @@ do
done


for i in {64..1}
for i in {4..1}
do
data=""
for j in {1..10}
do
result=$(srun ${path}/build/src/taylor_sender_receiver_hpx ${len} 0.5 $i --hpx:threads=$i)
result=$(srun --cpus-per-task=4 --ntasks-per-node=1 --ntasks-per-core=1 ${path}/build/src/taylor_sender_receiver_hpx ${len} 0.5 $i --hpx:threads=$i)
array=($result)
IFS=',' read -ra my_array <<< "${array[0]}"
data="$data ${my_array[1]}"
Expand Down
15 changes: 15 additions & 0 deletions rv64g-hpx.sbatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#SBATCH -N 1
#SBATCH --time=3:59:00
#SBATCH -p short
#SBATCH --job-name=hpx-taylor-%j
#SBATCH --output=hpx-taylor-%j.txt
#SBATCH --error=error-hpx_taylor-%j.txt

#module load gcc/12.1.0

date
./benchmark.sh rv64g
date


4 changes: 4 additions & 0 deletions rv64g_taylor_coroutine_hpx_median.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
4,00000030.549300,00000029.977600,00000030.915600
3,00000035.787400,00000035.254300,00000036.355900
2,00000046.635800,00000045.450000,00000047.075200
1,00000078.858100,00000075.663100,00000079.898400
4 changes: 4 additions & 0 deletions rv64g_taylor_future_hpx_median.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
4,00000016.725300,00000016.098100,00000017.564500
3,00000022.145800,00000021.225500,00000022.704700
2,00000033.696800,00000032.703000,00000034.246500
1,00000067.689900,00000062.041100,00000068.112900
4 changes: 4 additions & 0 deletions rv64g_taylor_future_median.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
4,00000014.640200,00000014.260800,00000015.013900
3,00000019.023900,00000018.573900,00000020.265100
2,00000029.025900,00000028.066100,00000030.248700
1,00000057.290900,00000055.238800,00000059.973600
4 changes: 4 additions & 0 deletions rv64g_taylor_par_hpx_median.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
4,00000016.706800,00000015.456700,00000017.121800
3,00000022.172100,00000020.350600,00000022.930400
2,00000033.489500,00000031.588900,00000034.402000
1,00000061.771700,00000060.268200,00000067.413200
4 changes: 4 additions & 0 deletions rv64g_taylor_sender_receiver_hpx_median.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
4,00000012.273500,00000012.058100,00000013.029800
3,00000016.151600,00000015.445400,00000016.666700
2,00000024.471400,00000022.359500,00000025.191300
1,00000049.739500,00000045.845000,00000052.465800
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ if(${HPX_FOUND})
endif()

add_executable(taylor_future taylor_future.cpp)
target_link_libraries(taylor_future PRIVATE Threads::Threads)
#target_link_libraries(taylor_future PRIVATE Threads::Threads)
target_link_libraries(taylor_future Threads::Threads)
add_test(NAME "Parallel:_Taylor_future" COMMAND taylor_future 100 0.5 3)

if(NOT APPLE AND "${FOUND_OPENMP}")
Expand Down

0 comments on commit 87e4af1

Please sign in to comment.