diff --git a/DiffractionGratings/grating3D_postplot_scaling.py b/DiffractionGratings/grating3D_postplot_scaling.py new file mode 100644 index 0000000000000000000000000000000000000000..283322c6d43150b0dcdda498cbea9273c939cdd5 --- /dev/null +++ b/DiffractionGratings/grating3D_postplot_scaling.py @@ -0,0 +1,31 @@ +import numpy as np +import matplotlib.pyplot as plt +plt.figure() +temp = np.genfromtxt('temp_scaling_runtime_MUMPS.out',delimiter=' ',dtype=None,encoding=None)[:,7] +runtime_MUMPS = np.array([np.float(temp[i][:-2]) for i in range(len(temp))]) + + +tab_procs = np.loadtxt('temp_scaling_nbproc.out') +tab_paramaille = np.loadtxt('temp_scaling_paramaille.out') +runtime_MUMPS = runtime_MUMPS.reshape((len(tab_paramaille),len(tab_procs))) + +temp = np.genfromtxt('temp_scaling_NDOFs.out',delimiter=' ',dtype=None,encoding=None) +NDofs = [temp[k][6] for k in range(0,len(tab_procs)*len(tab_paramaille),len(tab_procs))] + + +plt.figure() +for k in range(len(tab_paramaille)): + plt.plot(tab_procs,runtime_MUMPS[k,:],label='%g'%NDofs[k]) +plt.legend() +plt.xlabel("nprocs") +plt.xlabel("MUMPS wall time (s)") +plt.savefig('runtime.jpg') + +plt.figure() +for k in range(len(tab_paramaille)): + plt.plot(tab_procs,runtime_MUMPS[k,0]/runtime_MUMPS[k,:],label='%g'%NDofs[k]) +plt.legend(title="Matrix size") +plt.xlabel("number of procs") +plt.ylabel("speedup") +plt.savefig('speedup.jpg') +# plt.show() \ No newline at end of file diff --git a/DiffractionGratings/grating3D_scaling.sh b/DiffractionGratings/grating3D_scaling.sh new file mode 100644 index 0000000000000000000000000000000000000000..3f3439d65256568e3505ec97d3c640030b9b349c --- /dev/null +++ b/DiffractionGratings/grating3D_scaling.sh @@ -0,0 +1,21 @@ +#!/bin/bash +export OPENBLAS_NUM_THREADS=1 +export OMP_NUM_THREADS=1 +export GRATING_CASE="halfellipsoid" + +rm -rf res3D temp_scaling_nbproc.out temp_scaling_paramaille.out temp_scaling_runtime_MUMPS.out rm temp.out + +for p in 5 10 15 20 25 30 35 40 +do + echo $p >> temp_scaling_paramaille.out + gmsh grating3D.geo -3 -o grating3D.msh -setstring test_case $GRATING_CASE -setnumber paramaille $p + for i in 1 2 4 6 8 10 12 14 16 20 24 28 32 40 44 + do + if [ "$p" -eq "1" ]; then echo $i >> temp_scaling_nbproc.out ; fi + export OPENBLAS_NUM_THREADS=$i + getdp grating3D.pro -pre helmholtz_vector -msh grating3D.msh -cal -pos postop_helmholtz_vector -petsc_prealloc 200 -setstring test_case $GRATING_CASE + done +done +grep 'N:' nohup.out > temp_scaling_NDOFs.out +grep -A1 'N:' nohup.out > temp.out && grep 'Wall' temp.out > temp_scaling_runtime_MUMPS.out +rm temp.out