Browse code

bash_profile (heron) - v3.4 - Switch from SGE to Slurm

Fred authored on20/12/2025 22:36:07
Showing1 changed files
... ...
@@ -1,14 +1,15 @@
1 1
 # Title: .bash_profile
2 2
 # Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
-# Version: 3.3
3
+# Version: 3.4
4 4
 # Created in: 2012-05-25
5
-# Modified in: 2024-12-16
5
+# Modified in: 2025-12-20
6 6
 
7 7
 
8 8
 #==========#
9 9
 # Versions #
10 10
 #==========#
11 11
 
12
+# v3.4 - 2025-12-20: switch SGE commands to Slurm commands / remove linuxbrew, system and perl lib paths, aliases
12 13
 # v3.3 - 2024-12-16: switch from miniconda to miniforge
13 14
 # v3.2 - 2022-09-10: add timeout on welcome message
14 15
 # v3.1 - 2021-05-19: updates related to severs and SGE config changes (e.g., queue) / new env variable added
... ...
@@ -49,17 +50,13 @@
49 50
 # Specific aliases #
50 51
 #==================#
51 52
 
52
-alias pqsub='qsub -V -cwd -o $HOME/status -j y -r y -S /bin/bash'
53
-alias pqsubR='qsub -V -cwd -o $HOME/status -j y -r y -S $(which Rscript)'
54
-alias pqrsh='qrsh -V -cwd -q interactive.q -pty y bash -li'
53
+alias psrun='srun --export=ALL --pty --partition=interactive bash -li'
55 54
 alias plocate='locate -d "$mlocate_db"'
56 55
 alias xterm='xterm -bg black -fg white -rightbar -geometry 200x35'
57 56
 
58 57
 [[ $HOSTNAME =~ heron* ]] && alias ssh="ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no"
59 58
 alias zeus='ssh zeus'
60
-alias mendel='ssh mendel'
61
-alias crow='ssh crow'
62
-alias bulmer='ssh bulmer'
59
+alias titan='ssh titan'
63 60
 
64 61
 alias pypm="pypm -g"    # Default parameter for pypm which is a package manager for python
65 62
 alias model_script_sh='cp $HOME/Templates/script.sh $1'
... ...
@@ -94,16 +91,6 @@ export PKG_CONFIG_PATH=$(/usr/bin/pkg-config --variable pc_path pkg-config)
94 91
 # Path variable
95 92
 [[ $SHLVL -eq 1 ]] && export PATH=$HOME/local/bin:$HOME/local/share:$HOME/local/usr/local/bin:${PATH:+:$PATH}     # Personal path
96 93
 
97
-# Linuxbrew
98
-[[ $SHLVL -eq 1 && -d "$HOME/.linuxbrew" ]] && eval $("$HOME/.linuxbrew/bin/brew" shellenv)
99
-
100
-# Use of personal /lib* if recent OS
101
-# Location of bamtools lib (source: http://www.vcru.wisc.edu/simonlab/bioinformatics/programs/install/bamtools.htm)
102
-export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$HOME/local/lib:$HOME/local/lib64"
103
-
104
-# Perl
105
-export PERL5LIB=~/local/lib/perl5/site_perl/5.18.2/x86_64-linux/auto:~/local/lib/perl5/5.18.2:~/local/lib/perl5/site_perl:~/local/lib/perl5/site_perl/5.18.2:~/local/lib/perl5/site_perl/5.18.2/x86_64-linux:~/local/lib/perl5/5.18.2/x86_64-linux:/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.8:/usr/lib/perl5/site_perl:/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/vendor_perl/5.8.8:/usr/lib/perl5/vendor_perl:/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/5.8.8
106
-
107 94
 # Python
108 95
 export PYTHONIOENCODING=utf-8
109 96
 
... ...
@@ -134,16 +121,12 @@ export VIMHOME=$HOME/.vim
134 121
 # Biom completion
135 122
 [[ $(which biom &> /dev/null ; echo $?) == 0 ]] && eval "$(_BIOM_COMPLETE=source biom)"
136 123
 
137
-# Linuxbrew completion
138
-[[ -s "$HOME/.linuxbrew/etc/bash_completion.d/brew" ]] && source "$HOME/.linuxbrew/etc/bash_completion.d/brew"
139
-
140
-
141 124
 # SSH environment setup
142 125
 SSH_KEY_LIST="$HOME/.ssh/key_list"  # File with full path of keys (one per line) to load with start_agent
143 126
 [[ -f "$SSH_KEY_LIST" ]] && SSH_KEYS=($(cat $SSH_KEY_LIST))
144 127
 #lifetime="-t 259200" # seconds => 3 days
145 128
 
146
-if [[ ! ($HOSTNAME =~ heron* || $HOSTNAME =~ compute.*) ]]
129
+if [[ ! ($HOSTNAME =~ heron* || $HOSTNAME =~ n[0-9]*) ]]
147 130
 then
148 131
     if [[ -n "$SSH_CONNECTION" ]]
149 132
     then
... ...
@@ -166,7 +149,7 @@ fi
166 149
 
167 150
 # Display forwarding
168 151
 # dependency: proxy-dsiplay
169
-if [[ ! ($HOSTNAME =~ heron* || $HOSTNAME =~ zeus* || $HOSTNAME =~ compute.*) && -n "$DISPLAY" && $(which proxy-display &> /dev/null; echo $?) == 0 ]]
152
+if [[ ! ($HOSTNAME =~ heron* || $HOSTNAME =~ zeus* || $HOSTNAME =~ n[0-9]*) && -n "$DISPLAY" && $(which proxy-display &> /dev/null; echo $?) == 0 ]]
170 153
 then
171 154
     proxy-display :99
172 155
 fi
... ...
@@ -204,13 +187,13 @@ name=${HOSTNAME%%.*}
204 187
 nb=$(printf "%${#name}s\n" "" | sed "s/ /=/g")
205 188
 
206 189
 # Server message
207
-if [[ ! $HOSTNAME =~ compute.* && -z $STY && -z $LC_STY ]]
190
+if [[ ! $HOSTNAME =~ n[0-9]* && -z $STY && -z $LC_STY ]]
208 191
 then
209 192
     bash .welcome.msg
210 193
 fi
211 194
 
212 195
 # Info on disk space and cores
213
-if [[ ! ($HOSTNAME =~ heron* || $HOSTNAME =~ compute.*) && (-z $LC_STY || $LC_STY != 1) ]]
196
+if [[ ! ($HOSTNAME =~ heron* || $HOSTNAME =~ n[0-9].*) && (-z $LC_STY || $LC_STY != 1) ]]
214 197
 then
215 198
     mydisk="/master"
216 199
     dspace=$(timeout 5s df -h 2> /dev/null)
... ...
@@ -227,7 +210,7 @@ then
227 210
 
228 211
     if [[ ($name == "zeus") && (-z $LC_STY || $LC_STY != 1) ]]
229 212
     then
230
-        cores=$(timeout 5s qstat -g c)
213
+        cores=$(timeout 5s sinfo -o "%P|%a|%l|%D|%t|%C" | column -t -s "|")
231 214
         echo -e "\033[33mCores available:\033[00m\n"
232 215
         echo -e "$cores\n"
233 216
     fi