-
Notifications
You must be signed in to change notification settings - Fork 13
/
silentextractparallel
executable file
·58 lines (40 loc) · 1.31 KB
/
silentextractparallel
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
#!/bin/bash
tags=""
tmp_list=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13)
tmp_list="tmp_${tmp_list}.list"
rm $tmp_list > /dev/null 2>&1
if [ $# -eq 0 ]; then
echo >&2 ""
echo >&2 "OBSOLETE: Just use silentextract -j16"
echo >&2 ""
echo >&2 "silentextractparallel by bcov - a tool extract a silent file in parallel"
echo >&2 "Usage:"
echo >&2 " silentextractparallel myfile.silent"
echo >&2 "Flags:"
echo >&2 " -j cpus"
echo >&2 " -p param_file"
echo >&2 " @flags_file"
exit 1
fi
silent_dir="$(dirname $(type -p "$0"))"
source "$silent_dir"/_extract_flags.sh
if [ ! -f $1 ]; then
echo >&2 "silentextractparallel: $1 doesn't exist!"
exit 1
fi
if [ -z "${SILENT_J}" ]; then
"$silent_dir"/silentextract -j16 $SILENT_FLAGS_NO_J "$@"
else
"$silent_dir"/silentextract $SILENT_FLAGS_NO_J "$@"
fi
# tmp_fol=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13)
# tmp_fol="tmp_${tmp_fol}"
# cpus=16 #$(parallel --number-of-cores)
# silentls $1 > $tmp_list
# splitno=$((( $(wc -l $tmp_list | awk '{print $1}') / $cpus + 1)))
# mkdir $tmp_fol
# split -l $splitno $tmp_list $tmp_fol/x
# ls $tmp_fol/x* | parallel "cat {} | silentslice $1 > {}.silent"
# ls $tmp_fol/x*.silent | parallel 'silentextract {}'
# rm $tmp_list
# rm -r $tmp_fol