forked from centre-for-microbiome-research/hpc_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmr_bashrc_extras.bash
53 lines (43 loc) · 2.67 KB
/
cmr_bashrc_extras.bash
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
# Add HPC scripts e.g. mqsub to the path
export PATH="/mnt/hpccs01/work/microbiome/sw/hpc_scripts/bin:$PATH"
#function for command prompt and email notification of job completion
function notify { command "$@" && success || fail; }
#setup temporary file folder # No need for this since /tmp is /data1 in mounts
# export TMPDIR=/data1/tmp-$USER
# mkdir -p $TMPDIR
#check for nextflow config
if [[ ! -e ~/.nextflow/config ]]; then
NEXTFLOW_CONFIG=/mnt/hpccs01/work/microbiome/sw/nextflow_config/config
fi
# Otherwise qaddtime is only available on lyra # currently disabled due to abuse
#alias qaddtime=/pkg/hpc/scripts/qaddtime
# Save all the history, see https://debian-administration.org/article/543/Bash_eternal_history
export HISTTIMEFORMAT="%F %T "
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo $$ $USER \
"$(history 1)" >> ~/.bash_eternal_history'
#Path to kingfisher # symlinked /lustre/work-lustre/microbiome/sw/kingfisher-download/bin/kingfisher in $CONDA_PREFIX/envs/kingfisher/bin instead
export PATH=/work/microbiome/sw/kingfisher_repos/kingfisher-v0.4.1/kingfisher-download/bin:$PATH
export PATH=/work/microbiome/sw/recurm_repos/recurm/bin:$PATH
#add RAM usage limits
if [ `hostname` = "cl5n006" ] || [ `hostname` = "cl5n007" ] || [ `hostname` = "cl5n008" ] || [ `hostname` = "cl5n009" ]
then
case $- in *i*) echo "** Setting 750GB RAM ulimit **"; esac
ulimit -v $((750 * 1024 * 1024))
elif [ `hostname` = "cl5n005" ]
then
case $- in *i*) echo "** Setting 300GB RAM ulimit **"; esac
ulimit -v $((350 * 1024 * 1024))
fi
#notify about disk usage
case $- in *i*) echo "** cl5n005 disk usage (%): `cat /work/microbiome/cl5n005_disk_usage` **"; esac
case $- in *i*) echo "** cl5n006 disk usage (%): `cat /work/microbiome/cl5n006_disk_usage` **"; esac
case $- in *i*) echo "** cl5n007 disk usage (%): `cat /work/microbiome/cl5n007_disk_usage` **"; esac
case $- in *i*) echo "** cl5n008 disk usage (%): `cat /work/microbiome/cl5n008_disk_usage` **"; esac
case $- in *i*) echo "** cl5n009 disk usage (%): `cat /work/microbiome/cl5n009_disk_usage` **"; esac
case $- in *i*) echo "** cl5n010 disk usage (%): `cat /work/microbiome/cl5n010_disk_usage` **"; esac
case $- in *i*) echo "** cl5n011 disk usage (%): `cat /work/microbiome/cl5n011_disk_usage` **"; esac
case $- in *i*) echo "** cl5n012 disk usage (%): `cat /work/microbiome/cl5n012_disk_usage` **"; esac
case $- in *i*) echo "** cl5n013 disk usage (%): `cat /work/microbiome/cl5n013_disk_usage` **"; esac
# Setup snakemake config directories so it interfaces well with the PBS system
mkdir -p ~/.config/snakemake
cd ~/.config/snakemake && ln -sf /work/microbiome/sw/hpc_scripts/snakemake_configs/* . && cd $OLDPWD