-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path00_init.sh
executable file
·65 lines (44 loc) · 1.28 KB
/
00_init.sh
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
59
60
61
62
63
64
65
#!/bin/bash
#source this script in your .bash_profile:
# source ~/neuroglia-helpers/00_init.sh
#if you don't want to see the welcome message, use:
# source ~/neuroglia-helpers/00_init.sh light
#light version doesn't display welcome message
if [ "$#" = 1 ]
then
use_light=1
else
use_light=0
fi
if [ "$use_light" = 0 ]
then
echo "***"
echo " Initializing neuroglia-helpers"
fi
#-------- this section always gets run -------
export NEUROGLIA_DIR=$(dirname `realpath $BASH_SOURCE`)
export PATH=${NEUROGLIA_DIR}/bin:$PATH
export NEUROGLIA_BASH_LIB=$NEUROGLIA_DIR/etc/bash_lib.sh
set -a
source $NEUROGLIA_DIR/cfg/graham${cfg_profile}.cfg
set +a
#make SINGULARITY_DIR if it doesn't exist
if [ ! -e $SINGULARITY_DIR/bids-apps ]
then
mkdir -p $SINGULARITY_DIR/bids-apps
if [ ! "$?" = 0 -o ! -e $SINGULARITY_DIR ]
then
echo "neuroglia-helpers init error: Unable to set local SINGULARITY_DIR to $SINGULARITY_DIR"
fi
fi
#----------------------------------------------
if [ "$use_light" = 0 ]
then
echo " Container path: $SINGULARITY_DIR"
echo " Singularity options: $SINGULARITY_OPTS"
echo " Neuroglia container: $NEUROGLIA_URI"
echo " CPU account: $CC_COMPUTE_ALLOC"
#echo "- printGroupUsage currently disabled -"
$NEUROGLIA_DIR/etc/printGroupUsage ${CC_COMPUTE_ALLOC}_cpu
echo "***"
fi