-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all_by_size.sh
executable file
·63 lines (52 loc) · 2.33 KB
/
run_all_by_size.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -e
REPETITIONS=3
THREADS=(4 6 8)
DATASETS_SIZES=(1 10 100 500 1000 1500 2000)
export RUSTFLAGS="-L /usr/lib/python3.10/config-3.10-x86_64-linux-gnu -lpython3.10"
FIXED_DATASET="TCGA_BRCA_sampleMap_HiSeqV2_PANCAN_clean_processed_5MB.tsv"
fecha_actual=$(date +%d_%m_%Y)
result_for_time="time_results_benchmark_by_size_$fecha_actual.tsv"
result_for_memory="memory_results_benchmark_by_size_$fecha_actual.tsv"
export result_for_time
export result_for_memory
mkdir -p results/tmp
rm -f results/tmp/*
> "results/$result_for_time"
echo -e "Size of Dataset (MB)\tAlgorithm\tOptimization\tThreads\tMax resident memory (KB)\tTotal memory (resident + virtual)(KB)\tUnshared memory (KB)\tpercent of CPU" > "results/$result_for_memory"
for THREAD in "${THREADS[@]}"
do
for DATASET_SIZE in "${DATASETS_SIZES[@]}"
do
export DS=$DATASET_SIZE
DATASET="TCGA_BRCA_sampleMap_HumanMethylation450_clean_processed_${DATASET_SIZE}MB.tsv"
cd ggca-opts
echo "#Dataset" $DATASET_SIZE "MB - " $THREAD Threads
echo -e "Algorithm\tOptimization\tThreads\tFinished time (ms)\tCombinations evaluated" >"../results/tmp/$DATASET_SIZE-$THREAD.tsv"
echo "Running Pearson..."
bash run_pearson.sh $REPETITIONS $THREAD $DATASET $FIXED_DATASET >>"../results/tmp/$DATASET_SIZE-$THREAD.tsv"
echo "Running Kendalls..."
bash run_kendalls.sh $REPETITIONS $THREAD $DATASET $FIXED_DATASET >>"../results/tmp/$DATASET_SIZE-$THREAD.tsv"
echo "Running Spearman..."
bash run_spearman.sh $REPETITIONS $THREAD $DATASET $FIXED_DATASET >>"../results/tmp/$DATASET_SIZE-$THREAD.tsv"
cd ..
done
done
# RESULTS FOR TIME ARE COLLECTED INTO A SINGLE ORDERED TSV IN "RESULTS/TMP" FOLDER
archivos=($(ls results/tmp | grep -E '[0-9]+-[0-9]+\.tsv$'))
header_written=false
for archivo in "${archivos[@]}"; do
base_name=$(basename "results/tmp/$archivo")
primer_string=$(echo "$base_name" | cut -d'-' -f1)
while IFS= read -r line; do
if [[ $header_written == false ]]; then
echo -e "Size of Dataset (MB)\t${line}" >> "results/$result_for_time"
header_written=true
else
if [[ $line != $(head -n 1 "results/tmp/$archivo") ]]; then
echo -e "${primer_string}\t${line}" >> "results/$result_for_time"
fi
fi
done < "results/tmp/$archivo"
rm -f results/tmp/$archivo
done