command-vcut>/dev/null 2>&1 ||{echo>&2 "cut is required but not installed or not in the path. Aborting.";exit 1;}
command-vpwd>/dev/null 2>&1 ||{echo>&2 "pwd is required but not installed or not in the path. Aborting.";exit 1;}
command-vcat>/dev/null 2>&1 ||{echo>&2 "cat is required but not installed or not in the path. Aborting.";exit 1;}
command-vtest>/dev/null 2>&1 ||{echo>&2 "test is required but not installed or not in the path. Aborting.";exit 1;}
command-vuname>/dev/null 2>&1 ||{echo>&2 "uname is recommended but not installed or not in the path. Aborting.";exit 1;}
command-vhostname>/dev/null 2>&1 ||{echo>&2 "hostname is recommended but not installed or not in the path. Continuing though some cosmetic information may be missing.";}
command-vhostid>/dev/null 2>&1 ||{echo>&2 "hostid is recommended but not installed or not in the path. Continuing though some cosmetic information may be missing.";}
command-vuptime>/dev/null 2>&1 ||{echo>&2 "uptime is recommended but not installed or not in the path. Continuing though some cosmetic information may be missing.";}
command-vuname>/dev/null 2>&1 ||{echo>&2 "uname is recommended but not installed or not in the path. Continuing, but behavior is undetermined";}
command-vhostname>/dev/null 2>&1 ||{echo>&2 "hostname is recommended but not installed or not in the path. Continuing, though some cosmetic information may be missing.";}
command-vhostid>/dev/null 2>&1 ||{echo>&2 "hostid is recommended but not installed or not in the path. Continuing, though some cosmetic information may be missing.";}
command-vuptime>/dev/null 2>&1 ||{echo>&2 "uptime is recommended but not installed or not in the path. Continuing, though some cosmetic information may be missing.";}
command-v lscpu >/dev/null 2>&1 ||{echo>&2 "lscpu is required but not installed or not in the path. Aborting.";exit 1;}
command-vgrep>/dev/null 2>&1 ||{echo>&2 "grep is required but not installed or not in the path. Aborting.";exit 1;}
command-vtail>/dev/null 2>&1 ||{echo>&2 "tail is required but not installed or not in the path. Aborting.";exit 1;}
command-v free >/dev/null 2>&1 ||{echo>&2 "free is required but not installed or not in the path. Aborting.";exit 1;}
command-v free >/dev/null 2>&1 ||{echo>&2 "free is required but not installed or not in the path. Continuing, though some cosmetic information may be missing.";}
command-v rev >/dev/null 2>&1 ||{echo>&2 "rev is required but not installed or not in the path. Aborting.";exit 1;}
command-vseq>/dev/null 2>&1 ||{echo>&2 "seq is required but not installed or not in the path. Aborting.";exit 1;}
command-vtr>/dev/null 2>&1 ||{echo>&2 "tr is required but not installed or not in the path. Aborting.";exit 1;}
command-v prlimit >/dev/null 2>&1 ||{echo>&2 "prlimit is recommended but not installed or not in the path. Continuing, but memory limits will be ignored";}
command-vsort>/dev/null 2>&1 ||{echo>&2 "sort is recommended but not installed or not in the path. Continuing, but behavior is undetermined";}
command-v cgcreate >/dev/null 2>&1 ||{echo>&2 "cgcreate from package cgroup-tools/libcgroups is recommended but not installed or not in the path. Continuing, but memory limits will not be imposed. See the README for more info";}
echo
echo"base_path: ""$base_path"
echo"parent_path: ""$parent_path"
echo
index=1
echo"Listing args with \"\$@\":"
for arg in"$@"
do
echo"Arg #$index = $arg"
let"index+=1"
done# $@ sees arguments as separate words.
echo"Arg list seen as separate words."
echo
if[${debug_parsing}]
then
echo"base_path: ""$base_path"
echo"parent_path: ""$parent_path"
echo
#Make sure that we are seeing all arguments
index=1
echo"Listing args with \"\$@\":"
for arg in"$@"
do
echo"Arg #$index = $arg"
let"index+=1"
done# $@ sees arguments as separate words.
echo"Arg list seen as separate words."
echo
fi
#DEFAULTS
output_folder="./"
export long="false"
#Argument Parsing
cd"${base_path}"
if[$# -ge 1 -a-f"${@:1:1}"]
then
...
...
@@ -50,12 +56,21 @@ shift
if["${arg:0:1}"=="-"]
then
shift
echo"is a flag"
if[${debug_parsing}]
then
echo"is a flag"
fi
flag_set=$(echo$arg | tr-d'[:space:]')
echo"Number of combined flags: ""$((${#arg}-1))"
if[${debug_parsing}]
then
echo"Number of combined flags: ""$((${#arg}-1))"
fi
for j in$(seq 1 1 "$((${#arg}-1))")
do
echo"${arg:${j}:1}"
if[${debug_parsing}]
then
echo"${arg:${j}:1}"
fi
case"${arg:${j}:1}"in
o )
output_folder="${@:1:1}"
...
...
@@ -69,11 +84,11 @@ shift
then
echo"Output folder set successfully: ""${output_folder}"
else
echo"-o flag given with no output folder, aborting."
echo"-o flag given with no output folder, aborting."
exit 1
fi
;;
n )
n )
run_name="${@:1:1}"
shift
if["${run_name:0:1}"=="-"]
...
...
@@ -116,14 +131,20 @@ shift
if["${memory}"]
then
echo"Memory set successfully: ""${memory}""MB"
export memory
else
echo"-m flag given with no amount of memory, aborting."
echo"chunk_0.geno exists, file is most likely already split, if it is not, then remove the existing chunks from ${gigi_split_prefix%/*} and try again"
else
mkdir-p"${output_folder}/${run_name}/STATS"
echo"Long is: ""${long}"
$timecmd-o"${output_folder}/${run_name}/STATS/time${i}.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi_split}""${param_file##*/}""${num_chunks}""${gigi_split_prefix}""${long}"
echo"Split exit status: ""$?"
if[${verbose}]
then
echo"Long is: ""${long}"
fi
$timecmd-o"${output_folder}/${run_name}/STATS/time${i}.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi_split}""${param_file##*/}""${num_chunks}""${gigi_split_prefix}""${long}">"${output_folder}/${run_name}/LOGS/split.log"
$timecmd-o"${output_folder}/${run_name}/STATS/time${BASH_REMATCH}.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi}""${file}"-outD="${output_folder}/${run_name}/gigi_output/${BASH_REMATCH}"-long & pids+=("$!")
cgexec -g memory,cpu:test/test_limits $timecmd-o"${output_folder}/${run_name}/STATS/time${BASH_REMATCH}.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi}""${file}"-outD="${output_folder}/${run_name}/gigi_output/${BASH_REMATCH}"-long>"${output_folder}/${run_name}/LOGS/${BASH_REMATCH}.gigi.log" & pids+=("$!")
else
$timecmd-o"${output_folder}/${run_name}/STATS/time${BASH_REMATCH}.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi}""${file}"-outD="${output_folder}/${run_name}/gigi_output/${BASH_REMATCH}" & pids+=("$!")
cgexec -g memory,cpu:test/test_limits $timecmd-o"${output_folder}/${run_name}/STATS/time${BASH_REMATCH}.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi}""${file}"-outD="${output_folder}/${run_name}/gigi_output/${BASH_REMATCH}">"${output_folder}/${run_name}/LOGS/${BASH_REMATCH}.gigi.log" & pids+=("$!")
fi
echo"$!"
last_pid="$!"
echo"gigi pid: ""$last_pid"" for part: ""${BASH_REMATCH}"
fi
#i=$(($i+1))
done
#Check exit status
...
...
@@ -42,7 +47,7 @@ for pid in ${pids[*]}
do
if wait"${pid}"
then
echo"${pid}""$?"
echo"gigi exit status for pid: ""${pid}"" is ""$?"
$timecmd-o"${output_folder}/${run_name}/STATS/time_merge.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi_merge}""${output_folder}/${run_name}/gigi_output""${num_chunks}""${long}"
$timecmd-o"${output_folder}/${run_name}/STATS/time_merge.log"-f'memory in kilobytes %M real %e user %U sys %S command %C'"${gigi_merge}""${output_folder}/${run_name}/gigi_output""${num_chunks}""${long}">"${output_folder}/${run_name}/LOGS/merge.log"