Just a heads up, we don't have a huge amount of space on this machine, ~750 GB for the git repos. We can include some data in the projects, but really big datasets will need to remain elsewhere. For anyone new to Git, this is a fairly good place to start: http://gitref.org/index.html Documentation for Gitlab is available here: http://doc.gitlab.com/

Commit 438d7525 authored by Khalid Kunji's avatar Khalid Kunji

Fixed failure to follow symlink to find parent directory and adjusted signal traps

parent 96d1ffe0
#!/bin/bash
### GIGI Config Outputs ###
......@@ -45,9 +44,11 @@ export num_chunks=$(($threads_total - $threads_per_core))
if [ "${num_threads}" ]
then
#Compare with num_threads
if [ "$num_threads" -lt "$num_chunks" ]
if [ "$num_threads" -le "$threads_total" ]
then
export num_chunks="$num_threads"
else
echo "Given number of threads greater than number available, using default estimate."
fi
else
num_threads="$num_chunks"
......
......@@ -2,13 +2,8 @@
cd "${input_folder}"
function finish {
# kill straggling threads
killall --wait GIGI
}
trap finish EXIT
pids=()
run_list_var=()
if [[ ${queue_length} ]]
then
......@@ -37,16 +32,18 @@ then
exit 7
fi
echo "${file}" >> "${gigi_split_chunks_folder}"/run_list
run_list_var+=("${file}")
done
cat "${gigi_split_chunks_folder}"/run_list
echo "Run List: " "${run_list_var}"
#Run GIGI
waiting=true
i=0
j=0
while IFS= read -r line; do
if (( i++ >= queue_length )); then
wait -n # wait for any job to complete. New in 4.3
timeout --preserve-status 5 wait -n # wait for any job to complete. New in 4.3
fi
if [ -e "${output_folder}/${run_name}/gigi_output/${j}/impute.geno" ]
then
......@@ -70,7 +67,7 @@ then
fi
done < "${gigi_split_chunks_folder}"/run_list
wait # wait for the remaining processes
waiting=false
rm "${gigi_split_chunks_folder}"/run_list
else
......@@ -149,6 +146,7 @@ do
fi
done
waiting=true
#Check exit status
for pid in ${pids[*]}
do
......@@ -160,7 +158,7 @@ do
exit 1
fi
done
waiting=false
fi
cd "$parent_path"
#!/bin/bash
#GIGIMerge <directory> <partition count>
if [ ${verbose} ]
......
#!/bin/bash
#set -x
export base_path=$(pwd)
export parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
export waiting=false
function finish {
echo "SIGINT caught!"
if [ "$waiting" = true ]
then
echo "Attempting to kill unfinished GIGI threads..."
# kill straggling threads
#timeout --preserve-status 5 killall --wait -i GIGI
#if [ $? -ne 0 ]
#then
# timeout --preserve-status 5 killall --wait -i -s SIGKILL GIGI
#fi
killall --wait GIGI
fi
#echo "Killing self with SIGINT"
kill -INT $$
#echo "Killing self"
#timeout 5 kill $$
#echo "Hard killing self."
#timeout 5 kill -9 $$
}
#trap finish EXIT
trap 'finish; trap - SIGINT; kill -INT $$' SIGINT
#trap finish SIGTERM
export base_path=$(pwd)
export parent_path=$( cd "$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" ; pwd -P )
echo "Parent Path: " "${parent_path}"
cd "$parent_path"
if [ -p /dev/stdin ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment