Loading Benchmark/Benchmark.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -67,10 +67,10 @@ public: void printRow( const string& operation, int size, const Results& results ) { // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC;SPEEDUP\n"; // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC\n"; double speedup = results.linear / results.classic; cout << operation << ";" << refines << ";" << size << ";" << distribution << ";" << results.linear << ";" << results.classic << ";" << speedup << "\n"; << results.classic << "\n"; } }; Loading Loading @@ -329,7 +329,7 @@ main( Index argc, char const* argv[] ) // Print results CSVWriter writer( refineCoords.size(), distribution ); // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC;SPEEDUP\n"; // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC\n"; writer.printRow( OP_REFINEMENT, refineCoords.size(), resRef ); writer.printRow( OP_SEARCH, searchCoords.size(), resSearch ); writer.printRow( OP_SEARCH_ALL, searchCoords.size(), resSearchAll ); Loading Benchmark/BenchmarkMPI.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ using Index = int; using GridType = LinearOctree::AdaptiveGrid< Real, Device, Index >; using AbsOctree = TNL::Meshes::AbsAdaptiveGrid< Real, TNL::Devices::Host, Index >; constexpr Index TEST_ITERATIONS = 15; constexpr Index TEST_ITERATIONS = 10; const string REFINE_FILENAME = "refine_coords.txt"; const string SEARCH_FILENAME = "search_coords.txt"; Loading Loading @@ -104,6 +104,8 @@ benchmarkSeq( const string& benchDir ) readInfo( benchDir, 0 ); unique_ptr< AbsOctree > grid( new GridType() ); grid->refineCell( { 0.0, 0.0, 0.0 } ); // Start refinement the same as in parallel for( size_t i = 0; i < 8; ++i ) { vector< TNL::Containers::StaticArray< 3, Real > > coords = readPoints( benchDir, i, REFINE_FILENAME ); refineGrid( *grid, coords ); Loading Loading @@ -205,9 +207,9 @@ main( int argc, char const* argv[] ) if( processId == 0 ) { Real avgResult = sumResult / 8.0; Real speedUp = seqResult / worstResult; cerr << "REFINES;INSIDE;OUTSIDE;SEQ;AVG;BEST;WORST;SPEEDUP\n"; cerr << "REFINES;INSIDE;OUTSIDE;SEQ;AVG;BEST;WORST\n"; cout << refines << ";" << inside << ";" << outside << ";" << seqResult << ";" << avgResult << ";" << bestResult << ";" << worstResult << ";" << speedUp << "\n"; << worstResult << "\n"; } deinitMPI(); Loading Benchmark/create_mpi_instances.sh 0 → 100755 +60 −0 Original line number Diff line number Diff line #!/bin/bash DESIRED_REFINES=(100000 500000) DESIRED_SEARCHES_RATIO=(1 2) DESIRED_OUT_RATIO=(0.001 0.005 0.01 0.05 0.1 0.25) INSTANCES=5 # Stop on error set -e USAGE="Usage: ./script <generator> <outdir>" if [ $# -ne 2 ]; then echo $USAGE exit 1 fi GENERATOR="$1" OUTDIR="$2" COUNT=0 create() { local out_ratio="$1" local refine="$2" local search_ratio="$3" # searches = $(($refine * $search_ratio)) searches=$( echo "$refine * $search_ratio" | bc | cut -d'.' -f 1 ) outside=$( echo "$searches * $out_ratio" | bc | cut -d'.' -f 1 ) inside=$( echo "$searches - $outside" | bc | cut -d'.' -f 1 ) for i in $(seq 1 $INSTANCES); do RESULT_DIR="$OUTDIR/r$refine-i$inside-o$outside-$i-$COUNT" # Check if bench dir exists, remove if it does if [ -d $RESULT_DIR ]; then rm -rf $RESULT_DIR fi ./$GENERATOR $refine $inside $outside $RESULT_DIR echo "Created $RESULT_DIR" COUNT=$(($COUNT + 1)) done } # Check if outdir exists, remove if it does if [ -d $OUTDIR ]; then rm -rf $OUTDIR fi mkdir $OUTDIR # Create instances for refine in "${DESIRED_REFINES[@]}"; do for search_ratio in "${DESIRED_SEARCHES_RATIO[@]}"; do for out_ratio in "${DESIRED_OUT_RATIO[@]}"; do create "$out_ratio" "$refine" "$search_ratio" done done done No newline at end of file Benchmark/create_seq_instances.sh 0 → 100755 +56 −0 Original line number Diff line number Diff line #!/bin/bash DESIRED_DISTRIBUTIONS=("unif" "normal" "exp") DESIRED_REFINES=(10000 50000 100000 500000 1000000 5000000) DESIRED_SEARCHES_RATIO=(0.5 1 1.5 2 2.5 3 3.5 4) INSTANCES=5 # Stop on error set -e USAGE="Usage: ./script <generator> <outdir>" if [ $# -ne 2 ]; then echo $USAGE exit 1 fi GENERATOR="$1" OUTDIR="$2" COUNT=0 create() { local distribution="$1" local refine="$2" local search_ratio="$3" # searches = $(($refine * $search_ratio)) search=$( echo "$refine * $search_ratio" | bc | cut -d'.' -f 1 ) for i in $(seq 1 $INSTANCES); do RESULT_DIR="$OUTDIR/$distribution-r$refine-s$search-$i-$COUNT" # Check if bench dir exists, remove if it does if [ -d $RESULT_DIR ]; then rm -rf $RESULT_DIR fi ./$GENERATOR $refine $search $distribution $RESULT_DIR echo "Created $RESULT_DIR" COUNT=$(($COUNT + 1)) done } # Check if outdir exists, remove if it does if [ -d $OUTDIR ]; then rm -rf $OUTDIR fi mkdir $OUTDIR # Create instances for refine in "${DESIRED_REFINES[@]}"; do for search_ratio in "${DESIRED_SEARCHES_RATIO[@]}"; do for distribution in "${DESIRED_DISTRIBUTIONS[@]}"; do create "$distribution" "$refine" "$search_ratio" done done done Benchmark/gen_mpi_instance.py +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ def generate_coords_for_process(pos: Position, dir: str, refine_count: int, insi if __name__ == "__main__": if len(sys.argv) < 4: print( "Usage: ./gen_mpi_instance.py <number_of_coords_refine> <number_of_coords_inside> <number_of_coords_outside> [output_dir]") "Usage: ./script <number_of_coords_refine> <number_of_coords_inside> <number_of_coords_outside> [output_dir]") exit(1) number_refine = int(sys.argv[1]) Loading Loading
Benchmark/Benchmark.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -67,10 +67,10 @@ public: void printRow( const string& operation, int size, const Results& results ) { // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC;SPEEDUP\n"; // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC\n"; double speedup = results.linear / results.classic; cout << operation << ";" << refines << ";" << size << ";" << distribution << ";" << results.linear << ";" << results.classic << ";" << speedup << "\n"; << results.classic << "\n"; } }; Loading Loading @@ -329,7 +329,7 @@ main( Index argc, char const* argv[] ) // Print results CSVWriter writer( refineCoords.size(), distribution ); // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC;SPEEDUP\n"; // cerr << "OPERATION;REFINES;SIZE;DISTRIBUTION;LINEAR;CLASSIC\n"; writer.printRow( OP_REFINEMENT, refineCoords.size(), resRef ); writer.printRow( OP_SEARCH, searchCoords.size(), resSearch ); writer.printRow( OP_SEARCH_ALL, searchCoords.size(), resSearchAll ); Loading
Benchmark/BenchmarkMPI.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ using Index = int; using GridType = LinearOctree::AdaptiveGrid< Real, Device, Index >; using AbsOctree = TNL::Meshes::AbsAdaptiveGrid< Real, TNL::Devices::Host, Index >; constexpr Index TEST_ITERATIONS = 15; constexpr Index TEST_ITERATIONS = 10; const string REFINE_FILENAME = "refine_coords.txt"; const string SEARCH_FILENAME = "search_coords.txt"; Loading Loading @@ -104,6 +104,8 @@ benchmarkSeq( const string& benchDir ) readInfo( benchDir, 0 ); unique_ptr< AbsOctree > grid( new GridType() ); grid->refineCell( { 0.0, 0.0, 0.0 } ); // Start refinement the same as in parallel for( size_t i = 0; i < 8; ++i ) { vector< TNL::Containers::StaticArray< 3, Real > > coords = readPoints( benchDir, i, REFINE_FILENAME ); refineGrid( *grid, coords ); Loading Loading @@ -205,9 +207,9 @@ main( int argc, char const* argv[] ) if( processId == 0 ) { Real avgResult = sumResult / 8.0; Real speedUp = seqResult / worstResult; cerr << "REFINES;INSIDE;OUTSIDE;SEQ;AVG;BEST;WORST;SPEEDUP\n"; cerr << "REFINES;INSIDE;OUTSIDE;SEQ;AVG;BEST;WORST\n"; cout << refines << ";" << inside << ";" << outside << ";" << seqResult << ";" << avgResult << ";" << bestResult << ";" << worstResult << ";" << speedUp << "\n"; << worstResult << "\n"; } deinitMPI(); Loading
Benchmark/create_mpi_instances.sh 0 → 100755 +60 −0 Original line number Diff line number Diff line #!/bin/bash DESIRED_REFINES=(100000 500000) DESIRED_SEARCHES_RATIO=(1 2) DESIRED_OUT_RATIO=(0.001 0.005 0.01 0.05 0.1 0.25) INSTANCES=5 # Stop on error set -e USAGE="Usage: ./script <generator> <outdir>" if [ $# -ne 2 ]; then echo $USAGE exit 1 fi GENERATOR="$1" OUTDIR="$2" COUNT=0 create() { local out_ratio="$1" local refine="$2" local search_ratio="$3" # searches = $(($refine * $search_ratio)) searches=$( echo "$refine * $search_ratio" | bc | cut -d'.' -f 1 ) outside=$( echo "$searches * $out_ratio" | bc | cut -d'.' -f 1 ) inside=$( echo "$searches - $outside" | bc | cut -d'.' -f 1 ) for i in $(seq 1 $INSTANCES); do RESULT_DIR="$OUTDIR/r$refine-i$inside-o$outside-$i-$COUNT" # Check if bench dir exists, remove if it does if [ -d $RESULT_DIR ]; then rm -rf $RESULT_DIR fi ./$GENERATOR $refine $inside $outside $RESULT_DIR echo "Created $RESULT_DIR" COUNT=$(($COUNT + 1)) done } # Check if outdir exists, remove if it does if [ -d $OUTDIR ]; then rm -rf $OUTDIR fi mkdir $OUTDIR # Create instances for refine in "${DESIRED_REFINES[@]}"; do for search_ratio in "${DESIRED_SEARCHES_RATIO[@]}"; do for out_ratio in "${DESIRED_OUT_RATIO[@]}"; do create "$out_ratio" "$refine" "$search_ratio" done done done No newline at end of file
Benchmark/create_seq_instances.sh 0 → 100755 +56 −0 Original line number Diff line number Diff line #!/bin/bash DESIRED_DISTRIBUTIONS=("unif" "normal" "exp") DESIRED_REFINES=(10000 50000 100000 500000 1000000 5000000) DESIRED_SEARCHES_RATIO=(0.5 1 1.5 2 2.5 3 3.5 4) INSTANCES=5 # Stop on error set -e USAGE="Usage: ./script <generator> <outdir>" if [ $# -ne 2 ]; then echo $USAGE exit 1 fi GENERATOR="$1" OUTDIR="$2" COUNT=0 create() { local distribution="$1" local refine="$2" local search_ratio="$3" # searches = $(($refine * $search_ratio)) search=$( echo "$refine * $search_ratio" | bc | cut -d'.' -f 1 ) for i in $(seq 1 $INSTANCES); do RESULT_DIR="$OUTDIR/$distribution-r$refine-s$search-$i-$COUNT" # Check if bench dir exists, remove if it does if [ -d $RESULT_DIR ]; then rm -rf $RESULT_DIR fi ./$GENERATOR $refine $search $distribution $RESULT_DIR echo "Created $RESULT_DIR" COUNT=$(($COUNT + 1)) done } # Check if outdir exists, remove if it does if [ -d $OUTDIR ]; then rm -rf $OUTDIR fi mkdir $OUTDIR # Create instances for refine in "${DESIRED_REFINES[@]}"; do for search_ratio in "${DESIRED_SEARCHES_RATIO[@]}"; do for distribution in "${DESIRED_DISTRIBUTIONS[@]}"; do create "$distribution" "$refine" "$search_ratio" done done done
Benchmark/gen_mpi_instance.py +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ def generate_coords_for_process(pos: Position, dir: str, refine_count: int, insi if __name__ == "__main__": if len(sys.argv) < 4: print( "Usage: ./gen_mpi_instance.py <number_of_coords_refine> <number_of_coords_inside> <number_of_coords_outside> [output_dir]") "Usage: ./script <number_of_coords_refine> <number_of_coords_inside> <number_of_coords_outside> [output_dir]") exit(1) number_refine = int(sys.argv[1]) Loading