-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathrun_me.sh
More file actions
executable file
·99 lines (85 loc) · 2.7 KB
/
run_me.sh
File metadata and controls
executable file
·99 lines (85 loc) · 2.7 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#! /bin/bash
exec_path="./bin/"
data=""
epochs=""
num_threads=""
label=""
problem_size=""
# function to display welcome message
function welcome_msg {
echo "------------------------------------------"
echo "| Welcome to TMAC demos |"
echo "------------------------------------------"
echo "| Enter 0 to exit |"
echo "| Enter 1 to run least squares |"
echo "| Enter 2 to run lasso |"
echo "| Enter 3 to run l2 svm |"
echo "| Enter 4 to run l1 logistic regression |"
echo "| Enter 5 to run demo PRS |"
echo "------------------------------------------"
echo "| you can download testing data from: |"
echo "| https://github.com/uclaopt/datasets |"
echo "------------------------------------------"
}
# function to proess the input from the terminal
function process_app_with_data {
echo "Please enter the data file name:"
read data </dev/tty
echo "Please enter the label file name:"
read label </dev/tty
echo "Please enter the number epochs:"
read epochs </dev/tty
echo "Please enter the number of threads:"
read num_threads </dev/tty
}
function process_app_with_no_data {
echo "Please enter the problem size:"
read problem_size </dev/tty
echo "Please enter the number epochs:"
read epochs </dev/tty
echo "Please enter the number of threads:"
read num_threads </dev/tty
}
#################
welcome_msg
while read input </dev/tty; do
case $input in
0 )
exit 0 ;;
1 )
app="tmac_gd_ls"
process_app_with_data
exec="$exec_path$app -data ./data/$data -label ./data/$label -epoch $epochs -nthread $num_threads"
echo "start TMAC to solve the least squares problems."
$exec
exit 0 ;;
2 )
app="tmac_fbs_lasso"
process_app_with_data
exec="$exec_path$app -data ./data/$data -label ./data/$label -epoch $epochs -nthread $num_threads"
echo "starting TMAC to solve LASSO"
$exec
exit 0 ;;
3 )
app="tmac_fbs_l2_svm"
process_app_with_data
exec="$exec_path$app -data ./data/$data -label ./data/$label -epoch $epochs -nthread $num_threads"
echo "starting TMAC to solve L2_SVM"
$exec
exit 0 ;;
4 )
app="tmac_fbs_l1_log"
process_app_with_data
exec="$exec_path$app -data ./data/$data -epoch $epochs -nthread $num_threads"
echo "starting TMAC to solve sparse logistic regression"
$exec
exit 0 ;;
5 )
app="tmac_prs_demo"
process_app_with_no_data
exec="$exec_path$app -problem_size $problem_size $epochs -nthread $num_threads"
echo "starting TMAC to demo PRS"
$exec
exit 0 ;;
esac
done