omniopt2 7773__py3-none-any.whl → 8167__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of omniopt2 might be problematic. Click here for more details.
- .omniopt.py +1633 -1354
- .shellscript_functions +5 -5
- .tests/pylint.rc +687 -0
- README.md +0 -2
- omniopt +127 -38
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt.py +1633 -1354
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.shellscript_functions +5 -5
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/omniopt +127 -38
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/omniopt_plot +0 -4
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/omniopt_share +0 -11
- omniopt2-8167.data/data/bin/pylint.rc +687 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/requirements.txt +1 -2
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/setup.py +2 -1
- {omniopt2-7773.dist-info → omniopt2-8167.dist-info}/METADATA +2 -5
- omniopt2-8167.dist-info/RECORD +71 -0
- omniopt2.egg-info/PKG-INFO +2 -5
- omniopt2.egg-info/SOURCES.txt +1 -0
- omniopt2.egg-info/requires.txt +1 -2
- omniopt_plot +0 -4
- omniopt_share +0 -11
- pyproject.toml +1 -1
- requirements.txt +1 -2
- omniopt2-7773.dist-info/RECORD +0 -69
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.colorfunctions.sh +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.general.sh +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.helpers.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_cpu_ram_usage.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_general.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_gpu_usage.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_kde.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_scatter.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_scatter_generation_method.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_scatter_hex.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_time_and_exit_code.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_trial_index_result.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.omniopt_plot_worker.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.random_generator.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/.tpe.py +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/LICENSE +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/apt-dependencies.txt +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/omniopt_docker +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/omniopt_evaluate +0 -0
- {omniopt2-7773.data → omniopt2-8167.data}/data/bin/test_requirements.txt +0 -0
- {omniopt2-7773.dist-info → omniopt2-8167.dist-info}/WHEEL +0 -0
- {omniopt2-7773.dist-info → omniopt2-8167.dist-info}/licenses/LICENSE +0 -0
- {omniopt2-7773.dist-info → omniopt2-8167.dist-info}/top_level.txt +0 -0
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
exit 245
|
|
120
120
|
fi
|
|
121
121
|
|
|
122
|
-
VENV_DIR_NAME=".
|
|
122
|
+
VENV_DIR_NAME=".omniax_venvs/$(python3 --version | sed -e 's# #_#g')/$(uname -m)/"
|
|
123
123
|
|
|
124
124
|
ROOT_VENV_DIR=$HOME
|
|
125
125
|
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
bar="${bar} "
|
|
208
208
|
done
|
|
209
209
|
|
|
210
|
-
printf "[%s] %d
|
|
210
|
+
printf "[%s] %d%% \n" "$bar" "$percentage"
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
function ppip {
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
|
|
397
397
|
green_reset_line "${PROGRESSBAR}➤Environment $VENV_DIR was not found. Creating it..."
|
|
398
398
|
python3 -mvenv "$VENV_DIR/" || {
|
|
399
|
-
red_text "❌Failed to create Virtual Environment in $VENV_DIR"
|
|
399
|
+
red_text "❌Failed to create Virtual Environment in $VENV_DIR\n"
|
|
400
400
|
exit 20
|
|
401
401
|
}
|
|
402
402
|
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
rm -rf "$VENV_DIR"
|
|
424
424
|
|
|
425
425
|
python3 -mvenv "$VENV_DIR/" || {
|
|
426
|
-
red_text "❌Failed to create Virtual Environment in $VENV_DIR"
|
|
426
|
+
red_text "❌Failed to create Virtual Environment in $VENV_DIR\n"
|
|
427
427
|
rm -rf "$VENV_DIR"
|
|
428
428
|
exit 20
|
|
429
429
|
}
|
|
@@ -440,7 +440,7 @@
|
|
|
440
440
|
rm -rf "$VENV_DIR"
|
|
441
441
|
|
|
442
442
|
python3 -mvenv "$VENV_DIR/" || {
|
|
443
|
-
red_text "❌Failed to create Virtual Environment in $VENV_DIR"
|
|
443
|
+
red_text "❌Failed to create Virtual Environment in $VENV_DIR\n"
|
|
444
444
|
exit 20
|
|
445
445
|
}
|
|
446
446
|
|
|
@@ -181,46 +181,13 @@
|
|
|
181
181
|
trap - DEBUG
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
MAIN_PID=$$
|
|
185
|
-
|
|
186
|
-
log_cpu_usage() {
|
|
187
|
-
if [[ -n "$RUN_UUID" ]]; then
|
|
188
|
-
if command -v ps 2>/dev/null >/dev/null; then
|
|
189
|
-
mkdir -p logs
|
|
190
|
-
|
|
191
|
-
LOG_FILE="logs/${RUN_UUID}_cpu_log"
|
|
192
|
-
|
|
193
|
-
[[ ! -f "$LOG_FILE" ]] && echo "timestamp,process,command,cpu_usage" > "$LOG_FILE"
|
|
194
|
-
|
|
195
|
-
_continue=1
|
|
196
|
-
|
|
197
|
-
while [[ $_continue -eq 1 ]]; do
|
|
198
|
-
if ! kill -0 "$MAIN_PID" 2>/dev/null; then
|
|
199
|
-
_continue=0
|
|
200
|
-
fi
|
|
201
|
-
|
|
202
|
-
TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
|
|
203
|
-
|
|
204
|
-
if [[ -e "$LOG_FILE" ]]; then
|
|
205
|
-
ps -eo ppid,pid,pcpu,comm,args | awk -v ts="$TIMESTAMP" -v ppid=$$ 'NR>1 && $1 == ppid {print ts "," $4 "," substr($0, index($0,$5)) "," $3}' >> "$LOG_FILE"
|
|
206
|
-
else
|
|
207
|
-
_continue=0
|
|
208
|
-
fi
|
|
209
|
-
|
|
210
|
-
sleep 1
|
|
211
|
-
done &
|
|
212
|
-
fi
|
|
213
|
-
fi
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
#log_cpu_usage &
|
|
217
|
-
|
|
218
184
|
checkout_to_latest_tested_version=0
|
|
219
185
|
debug=0
|
|
220
186
|
main_process_gb=
|
|
221
187
|
run_tests_that_fail_on_taurus=0
|
|
222
188
|
force_local_execution=0
|
|
223
189
|
dryrun=0
|
|
190
|
+
worker_generator_path=""
|
|
224
191
|
has_sbatch=0
|
|
225
192
|
|
|
226
193
|
function parse_toml {
|
|
@@ -721,6 +688,7 @@
|
|
|
721
688
|
continue_previous_job=""
|
|
722
689
|
calculate_pareto_front_of_job=""
|
|
723
690
|
mem_gb=
|
|
691
|
+
dependency=
|
|
724
692
|
gpus=
|
|
725
693
|
time=
|
|
726
694
|
if [[ -z $root_venv_dir ]]; then
|
|
@@ -862,6 +830,7 @@ EOF
|
|
|
862
830
|
"experiment_name"
|
|
863
831
|
"reservation"
|
|
864
832
|
"time"
|
|
833
|
+
"dependency"
|
|
865
834
|
)
|
|
866
835
|
|
|
867
836
|
complex_options_str=""
|
|
@@ -957,6 +926,36 @@ $complex_options_str
|
|
|
957
926
|
|
|
958
927
|
;;
|
|
959
928
|
|
|
929
|
+
--worker_generator_path=*)
|
|
930
|
+
old_worker_generator_path=\$worker_generator_path
|
|
931
|
+
worker_generator_path="\${i#*=}"
|
|
932
|
+
|
|
933
|
+
if [[ -n \$old_worker_generator_path ]]; then
|
|
934
|
+
red_text "--worker_generator_path was specified more than once. Using the last one.\\n"
|
|
935
|
+
args_string=\$(echo "\$args_string" | sed -e 's#[[:space:]]*--worker_generator_path=.*[[:space:]][[:space:]]*# #')
|
|
936
|
+
fi
|
|
937
|
+
|
|
938
|
+
args_string+=" --worker_generator_path \$worker_generator_path "
|
|
939
|
+
|
|
940
|
+
;;
|
|
941
|
+
|
|
942
|
+
--worker_generator_path)
|
|
943
|
+
old_worker_generator_path=\$worker_generator_path
|
|
944
|
+
|
|
945
|
+
shift
|
|
946
|
+
k=\$((k+1))
|
|
947
|
+
|
|
948
|
+
worker_generator_path="\${args[k]}"
|
|
949
|
+
|
|
950
|
+
if [[ -n \$old_worker_generator_path ]]; then
|
|
951
|
+
red_text "--worker_generator_path was specified more than once. Using the last one.\\n"
|
|
952
|
+
args_string=\$(echo "\$args_string" | sed -e 's#[[:space:]]*--worker_generator_path.*[[:space:]][[:space:]]*# #')
|
|
953
|
+
fi
|
|
954
|
+
|
|
955
|
+
args_string+=" --worker_generator_path \$worker_generator_path "
|
|
956
|
+
|
|
957
|
+
;;
|
|
958
|
+
|
|
960
959
|
--calculate_pareto_front_of_job=*)
|
|
961
960
|
old_continue=\$calculate_pareto_front_of_job
|
|
962
961
|
calculate_pareto_front_of_job="\${i#*=}"
|
|
@@ -1057,6 +1056,19 @@ EOF
|
|
|
1057
1056
|
|
|
1058
1057
|
eval "$PARAM_EVAL"
|
|
1059
1058
|
|
|
1059
|
+
if [[ $worker_generator_path != "" ]]; then
|
|
1060
|
+
old_uuid_dir="$worker_generator_path/state_files/run_uuid"
|
|
1061
|
+
if [[ -e $old_uuid_dir ]]; then
|
|
1062
|
+
RUN_UUID=$(cat $old_uuid_dir)
|
|
1063
|
+
if [[ -z $SLURM_JOB_ID ]]; then
|
|
1064
|
+
yellow_text "--worker_generator_path defined: $worker_generator_path. Using UUID from that run."
|
|
1065
|
+
yellow_text "Set RUN_UUID to $RUN_UUID"
|
|
1066
|
+
fi
|
|
1067
|
+
else
|
|
1068
|
+
red_text "Old UUID cannot be found"
|
|
1069
|
+
fi
|
|
1070
|
+
fi
|
|
1071
|
+
|
|
1060
1072
|
if [[ $dryrun -eq 1 ]]; then
|
|
1061
1073
|
force_local_execution=1
|
|
1062
1074
|
live_share=0
|
|
@@ -1181,8 +1193,7 @@ EOF
|
|
|
1181
1193
|
myexit $exit_code
|
|
1182
1194
|
else
|
|
1183
1195
|
if [[ -z $OO_MAIN_TESTS ]]; then
|
|
1184
|
-
yellow_text "The current version was not thoroughly tested. It may contain bugs. Checkout to $tag_commit_hash to get the latest tested version."
|
|
1185
|
-
yellow_text "Use --checkout_to_latest_tested_version to automatically use the latest tested version."
|
|
1196
|
+
yellow_text "The current version was not thoroughly tested. It may contain bugs. Checkout to $tag_commit_hash or use --checkout_to_latest_tested_version to get the latest tested version."
|
|
1186
1197
|
fi
|
|
1187
1198
|
fi
|
|
1188
1199
|
fi
|
|
@@ -1348,6 +1359,14 @@ EOF
|
|
|
1348
1359
|
trap - ERR
|
|
1349
1360
|
set +e
|
|
1350
1361
|
|
|
1362
|
+
if [[ -z $dependency ]]; then
|
|
1363
|
+
_dependency=$(get_config_from_config_file "dependency" 0 2>/dev/null)
|
|
1364
|
+
retcode=$?
|
|
1365
|
+
if [[ $retcode -ne 0 ]] && [[ -n $_dependency ]]; then
|
|
1366
|
+
dependency=$_dependency
|
|
1367
|
+
fi
|
|
1368
|
+
fi
|
|
1369
|
+
|
|
1351
1370
|
if [[ -z $reservation ]]; then
|
|
1352
1371
|
_reservation=$(get_config_from_config_file "reservation" 0 2>/dev/null)
|
|
1353
1372
|
retcode=$?
|
|
@@ -1656,12 +1675,43 @@ EOF
|
|
|
1656
1675
|
fi
|
|
1657
1676
|
fi
|
|
1658
1677
|
|
|
1678
|
+
if [[ $dependency == "omniopt_singleton" ]]; then
|
|
1679
|
+
k=0
|
|
1680
|
+
deps=""
|
|
1681
|
+
while read -r job_id; do
|
|
1682
|
+
if scontrol show job "$job_id" 2>/dev/null | grep -qi omniopt; then
|
|
1683
|
+
[[ -n $deps ]] && deps+=","
|
|
1684
|
+
deps+="after:$job_id"
|
|
1685
|
+
k=$((k+1))
|
|
1686
|
+
fi
|
|
1687
|
+
done < <(squeue -h -u "$USER" -o "%A")
|
|
1688
|
+
|
|
1689
|
+
if (( k > 0 )); then
|
|
1690
|
+
dependency="$deps"
|
|
1691
|
+
echo "Automatic dependencies: $dependency"
|
|
1692
|
+
else
|
|
1693
|
+
dependency=""
|
|
1694
|
+
fi
|
|
1695
|
+
fi
|
|
1696
|
+
|
|
1697
|
+
if [[ -n $dependency ]]; then
|
|
1698
|
+
if [[ $dependency =~ ^(afterok:[0-9]+|afternotok:[0-9]+|after:[0-9]+|afterany:[0-9]+|singleton)(,(afterok:[0-9]+|afternotok:[0-9]+|after:[0-9]+|afterany:[0-9]+|singleton))*$ ]]; then
|
|
1699
|
+
if [[ $debug -eq 1 ]]; then
|
|
1700
|
+
yellow_text "Valid dependency found: $dependency. Adding it it to sbatch command."
|
|
1701
|
+
fi
|
|
1702
|
+
sbatch_command="$sbatch_command --dependency $dependency"
|
|
1703
|
+
else
|
|
1704
|
+
echo "Invalid dependency format: $dependency"
|
|
1705
|
+
fi
|
|
1706
|
+
fi
|
|
1707
|
+
|
|
1659
1708
|
sbatch_command+=" $SCRIPT_DIR/omniopt $args_string"
|
|
1660
1709
|
|
|
1661
1710
|
if [[ "$debug" -eq "1" ]] || [[ -n $PRINT_SBATCH_COMMAND ]]; then
|
|
1662
1711
|
yellow_text "$sbatch_command"
|
|
1663
1712
|
fi
|
|
1664
1713
|
|
|
1714
|
+
|
|
1665
1715
|
set +e
|
|
1666
1716
|
|
|
1667
1717
|
sbatch_result=$($sbatch_command)
|
|
@@ -1835,7 +1885,46 @@ EOF
|
|
|
1835
1885
|
exec 2> >(tee -ia $bash_logname >& 2)
|
|
1836
1886
|
fi
|
|
1837
1887
|
|
|
1838
|
-
|
|
1888
|
+
|
|
1889
|
+
exit_code_lines=$(grep -i "exit-code:*" "$LOG_PATH" 2>/dev/null)
|
|
1890
|
+
if [ $? -ne 0 ] || [ -z "$exit_code_lines" ]; then
|
|
1891
|
+
echo "WARN: grep failed or no exit-code line found."
|
|
1892
|
+
exit_code_lines=""
|
|
1893
|
+
fi
|
|
1894
|
+
|
|
1895
|
+
exit_code_sed=$(echo "$exit_code_lines" | sed -e 's#Exit-Code:*[[:space:]]*##i' -e 's#,.*##')
|
|
1896
|
+
if [ $? -ne 0 ] || [ -z "$exit_code_sed" ]; then
|
|
1897
|
+
echo "WARN: sed failed or no data after sed."
|
|
1898
|
+
exit_code_sed=""
|
|
1899
|
+
fi
|
|
1900
|
+
|
|
1901
|
+
exit_code_tail=$(echo "$exit_code_sed" | tail -n1)
|
|
1902
|
+
if [ $? -ne 0 ] || [ -z "$exit_code_tail" ]; then
|
|
1903
|
+
echo "WARN: tail failed or no data after tail."
|
|
1904
|
+
exit_code_tail=""
|
|
1905
|
+
fi
|
|
1906
|
+
|
|
1907
|
+
exit_code_only_digits=$(echo "$exit_code_tail" | grep -o '[0-9]\+')
|
|
1908
|
+
if [ -z "$exit_code_only_digits" ]; then
|
|
1909
|
+
echo "WARN: No valid exit code found, setting it to 3"
|
|
1910
|
+
exit_code_only_digits=3
|
|
1911
|
+
fi
|
|
1912
|
+
|
|
1913
|
+
exit_code="$exit_code_only_digits"
|
|
1914
|
+
|
|
1915
|
+
if ! [[ "$exit_code" =~ ^[0-9]+$ ]]; then
|
|
1916
|
+
echo "WARN: exit_code invalid ('$exit_code'), setting to 3"
|
|
1917
|
+
exit_code=3
|
|
1918
|
+
fi
|
|
1919
|
+
|
|
1920
|
+
if (( exit_code != 0 )); then
|
|
1921
|
+
if declare -f myexit > /dev/null; then
|
|
1922
|
+
myexit "$exit_code"
|
|
1923
|
+
else
|
|
1924
|
+
echo "WARN: myexit function not found, exiting with code $exit_code"
|
|
1925
|
+
exit "$exit_code"
|
|
1926
|
+
fi
|
|
1927
|
+
fi
|
|
1839
1928
|
else
|
|
1840
1929
|
red_text "$LOG_PATH could not be found\n"
|
|
1841
1930
|
fi
|
|
@@ -1865,7 +1954,7 @@ EOF
|
|
|
1865
1954
|
sbatch_command=$(echo "$sbatch_command" | sed -e 's#^[[:space:]]*##' -e 's#[[:space:]]*$##')
|
|
1866
1955
|
red_text "Failed to start sbatch job. Command:\n"
|
|
1867
1956
|
red_text "$sbatch_command\n"
|
|
1868
|
-
red_text "Exit-Code: $exit_code\n"
|
|
1957
|
+
red_text "Exit-Code (sbatch): $exit_code\n"
|
|
1869
1958
|
|
|
1870
1959
|
myexit $exit_code
|
|
1871
1960
|
fi
|
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
trap 'echo -e "${CYAN}$(date +"%Y-%m-%d %H:%M:%S")${NC} ${MAGENTA}| Line: $LINENO ${NC}${YELLOW}-> ${NC}${BLUE}[DEBUG]${NC} ${GREEN}$BASH_COMMAND${NC}"' DEBUG
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function unset_debug {
|
|
20
|
-
trap - DEBUG
|
|
21
|
-
}
|
|
22
|
-
|
|
23
19
|
RUN_VIA_RUNSH=1
|
|
24
20
|
export RUN_VIA_RUNSH
|
|
25
21
|
|
|
@@ -51,10 +51,6 @@
|
|
|
51
51
|
true
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function unset_debug {
|
|
55
|
-
trap - DEBUG
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
no_color=0
|
|
59
55
|
force=0
|
|
60
56
|
DEBUG=0
|
|
@@ -65,13 +61,6 @@
|
|
|
65
61
|
outfile=
|
|
66
62
|
send_single_runs=1
|
|
67
63
|
|
|
68
|
-
function join_by {
|
|
69
|
-
local d=${1-} f=${2-}
|
|
70
|
-
if shift 2; then
|
|
71
|
-
printf %s "$f" "${@/#/$d}"
|
|
72
|
-
fi
|
|
73
|
-
}
|
|
74
|
-
|
|
75
64
|
RUN_DIR=$1
|
|
76
65
|
|
|
77
66
|
function help {
|