diff --git a/experiments/pp_cov.sh b/experiments/pp_cov.sh index 271a6131..3435ebfc 100644 --- a/experiments/pp_cov.sh +++ b/experiments/pp_cov.sh @@ -1,101 +1,102 @@ #!/bin/bash -out=out_cov +out=out_cov_symm comp=stable dim=3 -for k in 9 19 29; do - for tol in 1e-2 1e-4 1e-6; do - rm -rf tmp* - for nnz in 1 2 4 8; do - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $2}' > tmp_err_med_nnz${nnz} - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $3}' > tmp_err_min_nnz${nnz} - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $4}' > tmp_err_max_nnz${nnz} - done - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $2}' >> tmp_err_med_gaussian - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $3}' >> tmp_err_min_gaussian - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4}' >> tmp_err_max_gaussian - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $2}' >> tmp_err_med_srht - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $3}' >> tmp_err_min_srht - grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $4}' >> tmp_err_max_srht - case $tol in - 1e-2) - color='red' - mark='';; - 1e-4) - color='green' - mark='square';; - 1e-6) - color='blue' - mark='triangle';; - esac - printf '\t\\addplot[color=%s, mark=%s*, only marks, mark size=2pt, error bars/.cd, y dir=both,y explicit]\n' $color $mark - printf '\tcoordinates { %% %s, %s\n' $tol $k - printf '\t\t(G, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_gaussian` `cat tmp_err_min_gaussian` `cat tmp_err_max_gaussian` - printf '\t\t(S1, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz1` `cat tmp_err_min_nnz1` `cat tmp_err_max_nnz1` - printf '\t\t(S2, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz2` `cat tmp_err_min_nnz2` `cat tmp_err_max_nnz2` - printf '\t\t(S4, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz4` `cat tmp_err_min_nnz4` `cat tmp_err_max_nnz4` - printf '\t\t(S8, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz8` `cat tmp_err_min_nnz8` `cat tmp_err_max_nnz8` - printf '\t\t(H, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_srht` `cat tmp_err_min_srht` `cat tmp_err_max_srht` - printf '\t};\n' - echo "" - done -done +# for k in 9 19 29; do +# for tol in 1e-2 1e-4 1e-6; do +# rm -rf tmp* +# for nnz in 1 2 4 8; do +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $2}' > tmp_err_med_nnz${nnz} +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $3}' > tmp_err_min_nnz${nnz} +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $4}' > tmp_err_max_nnz${nnz} +# done +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $2}' >> tmp_err_med_gaussian +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $3}' >> tmp_err_min_gaussian +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4}' >> tmp_err_max_gaussian +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $2}' >> tmp_err_med_srht +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $3}' >> tmp_err_min_srht +# grep "errors:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $4}' >> tmp_err_max_srht +# case $tol in +# 1e-2) +# color='red' +# mark='';; +# 1e-4) +# color='green' +# mark='square';; +# 1e-6) +# color='blue' +# mark='triangle';; +# esac +# printf '\t\\addplot[color=%s, mark=%s*, only marks, mark size=2pt, error bars/.cd, y dir=both,y explicit]\n' $color $mark +# printf '\tcoordinates { %% %s, %s\n' $tol $k +# printf '\t\t(G, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_gaussian` `cat tmp_err_min_gaussian` `cat tmp_err_max_gaussian` +# printf '\t\t(S1, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz1` `cat tmp_err_min_nnz1` `cat tmp_err_max_nnz1` +# printf '\t\t(S2, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz2` `cat tmp_err_min_nnz2` `cat tmp_err_max_nnz2` +# printf '\t\t(S4, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz4` `cat tmp_err_min_nnz4` `cat tmp_err_max_nnz4` +# printf '\t\t(S8, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_nnz8` `cat tmp_err_min_nnz8` `cat tmp_err_max_nnz8` +# printf '\t\t(H, %s) -= (0, %s) += (0, %s)\n' `cat tmp_err_med_srht` `cat tmp_err_min_srht` `cat tmp_err_max_srht` +# printf '\t};\n' +# echo "" +# done +# done -for k in 9 19 29; do - for tol in 1e-2 1e-4 1e-6; do - rm -rf tmp* - for nnz in 1 2 4 8; do - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $2}' > tmp_ranks_med_nnz${nnz} - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $3}' > tmp_ranks_min_nnz${nnz} - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $4}' > tmp_ranks_max_nnz${nnz} - done - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $2}' >> tmp_ranks_med_gaussian - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $3}' >> tmp_ranks_min_gaussian - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4}' >> tmp_ranks_max_gaussian - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $2}' >> tmp_ranks_med_srht - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $3}' >> tmp_ranks_min_srht - grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $4}' >> tmp_ranks_max_srht - case $tol in - 1e-2) - color='red' - mark='';; - 1e-4) - color='green' - mark='square';; - 1e-6) - color='blue' - mark='triangle';; - esac - # case $k in - # 10000) mark='';; - # 20000) mark='square';; - # 40000) mark='triangle';; - # esac - # case $tol in - # 1e-2) color='red';; - # 1e-4) color='green';; - # 1e-6) color='blue';; - # esac - printf '\t\\addplot[color=%s, mark=%s*, only marks, mark size=2pt, error bars/.cd, y dir=both,y explicit]\n' $color $mark - printf '\tcoordinates { %% %s, %s\n' $tol $k - printf '\t\t(G, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_gaussian` `cat tmp_ranks_min_gaussian` `cat tmp_ranks_max_gaussian` - printf '\t\t(S1, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz1` `cat tmp_ranks_min_nnz1` `cat tmp_ranks_max_nnz1` - printf '\t\t(S2, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz2` `cat tmp_ranks_min_nnz2` `cat tmp_ranks_max_nnz2` - printf '\t\t(S4, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz4` `cat tmp_ranks_min_nnz4` `cat tmp_ranks_max_nnz4` - printf '\t\t(S8, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz8` `cat tmp_ranks_min_nnz8` `cat tmp_ranks_max_nnz8` - printf '\t\t(H, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_srht` `cat tmp_ranks_min_srht` `cat tmp_ranks_max_srht` - printf '\t};\n' - echo "" +# for k in 9 19 29; do +# for tol in 1e-2 1e-4 1e-6; do +# rm -rf tmp* +# for nnz in 1 2 4 8; do +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $2}' > tmp_ranks_med_nnz${nnz} +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $3}' > tmp_ranks_min_nnz${nnz} +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{print $4}' > tmp_ranks_max_nnz${nnz} +# done +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $2}' >> tmp_ranks_med_gaussian +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $3}' >> tmp_ranks_min_gaussian +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4}' >> tmp_ranks_max_gaussian +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $2}' >> tmp_ranks_med_srht +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $3}' >> tmp_ranks_min_srht +# grep "ranks:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SRHT | awk '{print $4}' >> tmp_ranks_max_srht +# case $tol in +# 1e-2) +# color='red' +# mark='';; +# 1e-4) +# color='green' +# mark='square';; +# 1e-6) +# color='blue' +# mark='triangle';; +# esac +# # case $k in +# # 10000) mark='';; +# # 20000) mark='square';; +# # 40000) mark='triangle';; +# # esac +# # case $tol in +# # 1e-2) color='red';; +# # 1e-4) color='green';; +# # 1e-6) color='blue';; +# # esac +# printf '\t\\addplot[color=%s, mark=%s*, only marks, mark size=2pt, error bars/.cd, y dir=both,y explicit]\n' $color $mark +# printf '\tcoordinates { %% %s, %s\n' $tol $k +# printf '\t\t(G, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_gaussian` `cat tmp_ranks_min_gaussian` `cat tmp_ranks_max_gaussian` +# printf '\t\t(S1, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz1` `cat tmp_ranks_min_nnz1` `cat tmp_ranks_max_nnz1` +# printf '\t\t(S2, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz2` `cat tmp_ranks_min_nnz2` `cat tmp_ranks_max_nnz2` +# printf '\t\t(S4, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz4` `cat tmp_ranks_min_nnz4` `cat tmp_ranks_max_nnz4` +# printf '\t\t(S8, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_nnz8` `cat tmp_ranks_min_nnz8` `cat tmp_ranks_max_nnz8` +# printf '\t\t(H, %s) -= (0, %s) += (0, %s)\n' `cat tmp_ranks_med_srht` `cat tmp_ranks_min_srht` `cat tmp_ranks_max_srht` +# printf '\t};\n' +# echo "" - done -done +# done +# done for tol in 1e-2 1e-4 1e-6; do - echo $tol - for k in 9 19 29; do + echo "# $tol" + # for k in 9 19 29; do + for k in 29; do rm -rf tmp* for nnz in 1 2 4 8; do grep "A\*S time\|AT\*S time" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{sum+=$5} END {print sum/3.0/1000.0}' > tmp_sample_nnz${nnz} @@ -110,10 +111,20 @@ for tol in 1e-2 1e-4 1e-6; do grep "Number of unknowns:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4/1000.0}' >> tmp_N_gaussian grep "\% of dense" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $6}' | tail -n 1 | sed 's/%//'>> tmp_compr -# printf '& & %s & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + # printf '& & %s & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n' `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n %3.3g' \ + `paste tmp_sample_gaussian tmp_constr_gaussian | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz1 tmp_constr_nnz1 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz2 tmp_constr_nnz2 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz4 tmp_constr_nnz4 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz8 tmp_constr_nnz8 | awk '{print $2-$1}'` \ + `paste tmp_sample_srht tmp_constr_srht | awk '{print $2-$1}'` \ + `cat tmp_constr_gaussian` + - # printf '& & %s & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.3f & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` - printf '& & %s & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` done echo "" done diff --git a/experiments/pp_front.sh b/experiments/pp_front.sh index f1640bbc..e402e7c7 100644 --- a/experiments/pp_front.sh +++ b/experiments/pp_front.sh @@ -1,6 +1,6 @@ #!/bin/bash -out=out_front +out=out_front_symm comp=stable for k in 100 150 200; do @@ -93,7 +93,8 @@ done for tol in 1e-2 1e-4 1e-6; do echo $tol - for k in 100 150 200; do + # for k in 100 150 200; do + for k in 200; do rm -rf tmp* for nnz in 1 2 4 8; do grep "A\*S time\|AT\*S time" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{sum+=$5} END {print sum/3.0/1000.0}' > tmp_sample_nnz${nnz} @@ -108,7 +109,18 @@ for tol in 1e-2 1e-4 1e-6; do grep "Number of unknowns:" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4/1000.0}' >> tmp_N_gaussian grep "\% of dense" ${out}/out_dim${dim}_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $6}' | tail -n 1 | sed 's/%//'>> tmp_compr - printf '& & %s & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + # printf '& & %s & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %3.4g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n' `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n %3.3g' \ + `paste tmp_sample_gaussian tmp_constr_gaussian | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz1 tmp_constr_nnz1 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz2 tmp_constr_nnz2 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz4 tmp_constr_nnz4 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz8 tmp_constr_nnz8 | awk '{print $2-$1}'` \ + `paste tmp_sample_srht tmp_constr_srht | awk '{print $2-$1}'` \ + `cat tmp_constr_gaussian` + done echo "" done diff --git a/experiments/pp_qc.sh b/experiments/pp_qc.sh index abed3762..80cdff3e 100644 --- a/experiments/pp_qc.sh +++ b/experiments/pp_qc.sh @@ -1,6 +1,6 @@ #!/bin/bash -out=out_qc +out=out_qc_symm comp=stable for k in 10000 20000 40000; do @@ -94,7 +94,8 @@ done for tol in 1e-2 1e-4 1e-6; do echo $tol - for k in 10000 20000 40000; do + # for k in 10000 20000 40000; do + for k in 40000; do rm -rf tmp* for nnz in 1 2 4 8; do grep "A\*S time\|AT\*S time" ${out}/out_dim_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{sum+=$5} END {print sum/3./1000.0}' > tmp_sample_nnz${nnz} @@ -109,8 +110,19 @@ for tol in 1e-2 1e-4 1e-6; do grep "Number of unknowns:" ${out}/out_dim_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4/1000.0}' >> tmp_N_gaussian grep "\% of dense" ${out}/out_dim_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $6}' | tail -n 1 | sed 's/%//'>> tmp_compr - # printf '& & %s & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.0f & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` - printf '& & %s & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + # printf '& & %s & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n' `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n %3.3g' \ + `paste tmp_sample_gaussian tmp_constr_gaussian | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz1 tmp_constr_nnz1 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz2 tmp_constr_nnz2 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz4 tmp_constr_nnz4 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz8 tmp_constr_nnz8 | awk '{print $2-$1}'` \ + `paste tmp_sample_srht tmp_constr_srht | awk '{print $2-$1}'` \ + `cat tmp_constr_gaussian` + done echo "" done diff --git a/experiments/pp_sie.sh b/experiments/pp_sie.sh index 28a94865..c597163d 100644 --- a/experiments/pp_sie.sh +++ b/experiments/pp_sie.sh @@ -94,7 +94,8 @@ done for tol in 1e-2 1e-4 1e-6; do echo $tol - for k in 5000 10000 20000; do + # for k in 5000 10000 20000; do + for k in 20000; do rm -rf tmp* for nnz in 1 2 4 8; do grep "A\*S time\|AT\*S time" ${out}/out_dim_k${k}*tol${tol}*${comp}_SJLT_nnz${nnz} | awk '{sum+=$5} END {print sum/3./1000.0}' > tmp_sample_nnz${nnz} @@ -109,7 +110,19 @@ for tol in 1e-2 1e-4 1e-6; do grep "Number of unknowns:" ${out}/out_dim_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $4/1000.0}' >> tmp_N_gaussian grep "\% of dense" ${out}/out_dim_k${k}*tol${tol}*${comp}_Gaussian | awk '{print $6}' | tail -n 1 | sed 's/%//'>> tmp_compr - printf '& & %s & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + # printf '& & %s & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %3.3g & %5.1f \\\\ \n' $k `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` `cat tmp_constr_gaussian` `cat tmp_constr_nnz1` `cat tmp_constr_nnz2` `cat tmp_constr_nnz4` `cat tmp_constr_nnz8` `cat tmp_constr_srht` `cat tmp_compr` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n' `cat tmp_sample_gaussian` `cat tmp_sample_nnz1` `cat tmp_sample_nnz2` `cat tmp_sample_nnz4` `cat tmp_sample_nnz8` `cat tmp_sample_srht` + + printf '(G, %3.3g)\n (S1, %3.3g)\n (S2, %3.3g)\n (S4, %3.3g)\n (S8, %3.3g)\n (H, %3.3g)\n\n %3.3g' \ + `paste tmp_sample_gaussian tmp_constr_gaussian | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz1 tmp_constr_nnz1 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz2 tmp_constr_nnz2 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz4 tmp_constr_nnz4 | awk '{print $2-$1}'` \ + `paste tmp_sample_nnz8 tmp_constr_nnz8 | awk '{print $2-$1}'` \ + `paste tmp_sample_srht tmp_constr_srht | awk '{print $2-$1}'` \ + `cat tmp_constr_gaussian` + done echo "" done diff --git a/experiments/run_cov.sh b/experiments/run_cov.sh index 63c25524..0665415d 100644 --- a/experiments/run_cov.sh +++ b/experiments/run_cov.sh @@ -11,7 +11,7 @@ export OMP_NUM_THREADS=$T export OMP_PLACES=threads export OMP_PROC_BIND=spread -out=out_cov +out=out_cov_symm mkdir $out leaf=256 diff --git a/experiments/run_front.sh b/experiments/run_front.sh index e6ca676c..d95c75ec 100644 --- a/experiments/run_front.sh +++ b/experiments/run_front.sh @@ -11,17 +11,15 @@ export OMP_NUM_THREADS=$T export OMP_PLACES=threads export OMP_PROC_BIND=spread -out=out_front +out=out_front_symm mkdir $out leaf=256 comp=stable -# for tol in 1e-2 1e-4 1e-6; do -for tol in 1e-6; do +for tol in 1e-2 1e-4 1e-6; do echo $tol - # for k in 100 150 200; do - for k in 200; do + for k in 100 150 200; do echo $k sampling=SJLT for nnz in 1 2 4 8; do diff --git a/experiments/run_qc.sh b/experiments/run_qc.sh index 254de381..2db6fb38 100644 --- a/experiments/run_qc.sh +++ b/experiments/run_qc.sh @@ -11,7 +11,7 @@ export OMP_NUM_THREADS=$T export OMP_PLACES=threads export OMP_PROC_BIND=spread -out=out_qc +out=out_qc_symm mkdir $out leaf=256 diff --git a/src/HSS/HSSExtra.hpp b/src/HSS/HSSExtra.hpp index 186bc6e9..ad2c773f 100644 --- a/src/HSS/HSSExtra.hpp +++ b/src/HSS/HSSExtra.hpp @@ -244,9 +244,13 @@ namespace strumpack { auto begin = tnow(); gemm(Trans::N, Trans::N, scalar_t(1.), _A, Rr, scalar_t(0.), Sr); std::cout << "# A*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#if defined(SYMMETRIC_SKETCHING) + Sc.copy(Sr); +#else begin = tnow(); gemm(Trans::C, Trans::N, scalar_t(1.), _A, Rc, scalar_t(0.), Sc); std::cout << "# AT*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#endif } void operator()(const std::vector& I, const std::vector& J, DenseM_t& B) { diff --git a/src/HSS/HSSMatrix.compress_stable.hpp b/src/HSS/HSSMatrix.compress_stable.hpp index 1c645b0c..9a2afdf5 100644 --- a/src/HSS/HSSMatrix.compress_stable.hpp +++ b/src/HSS/HSSMatrix.compress_stable.hpp @@ -79,11 +79,15 @@ namespace strumpack { if (opts.verbose()) std::cout << "# A*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; - begin = tnow(); +#if defined(SYMMETRIC_SKETCHING) + Sc_new.copy(Sr_new); +#else + begin = tnow(); matrixT_times_SJLT(A, S, Sc_new); if (opts.verbose()) std::cout << "# AT*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#endif } else { begin = tnow(); SJLTMatrix temp @@ -98,11 +102,15 @@ namespace strumpack { if (opts.verbose()) std::cout << "# A*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#if defined(SYMMETRIC_SKETCHING) + Sc_new.copy(Sr_new); +#else begin = tnow(); matrixT_times_SJLT(A, temp, Sc_new); if (opts.verbose()) std::cout << "# AT*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#endif total_nnz += opts.nnz(); } Rc_new.copy(Rr_new); @@ -170,6 +178,10 @@ namespace strumpack { std::cout << "# A*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#if defined(SYMMETRIC_SKETCHING) + Rc.copy(Rr); + Sc.copy(Sr); +#else begin = tnow(); std::vector svc = slice(svecc, 0, d+dd); std::sort(svc.begin(), svc.end()); @@ -180,7 +192,7 @@ namespace strumpack { if (opts.verbose()) std::cout << "# AT*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; - +#endif while (!this->is_compressed()) { #pragma omp parallel if(!omp_in_parallel()) #pragma omp single nowait @@ -207,6 +219,10 @@ namespace strumpack { std::cout << "# A*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#if defined(SYMMETRIC_SKETCHING) + Rc.copy(Rr); + Sc.copy(Sr); +#else begin = tnow(); std::vector svc = slice(svecc, d, d+dd); std::sort(svc.begin(), svc.end()); @@ -215,6 +231,7 @@ namespace strumpack { if (opts.verbose()) std::cout << "# AT*S time = " << dt(begin, tnow()) << " [10e-3s]" << std::endl; +#endif } } } else diff --git a/src/HSS/HSSMatrix.cpp b/src/HSS/HSSMatrix.cpp index 84b3af2d..e4a71d55 100644 --- a/src/HSS/HSSMatrix.cpp +++ b/src/HSS/HSSMatrix.cpp @@ -27,6 +27,8 @@ * */ +#define SYMMETRIC_SKETCHING 1 + #include "HSSMatrix.hpp"