Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/loadreads.sh @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 69:33d812a61356 |
---|---|
1 #!/bin/bash | |
2 | |
3 usage(){ | |
4 echo " | |
5 Written by Brian Bushnell | |
6 Last modified July 10, 2017 | |
7 | |
8 Description: Tests the memory usage of a sequence file. | |
9 | |
10 Usage: loadreads.sh in=<file> | |
11 | |
12 Parameters: | |
13 in= Input file. | |
14 lowcomplexity=f Assume input library is low-complexity. | |
15 | |
16 Java Parameters: | |
17 -Xmx This will set Java's memory usage, overriding autodetection. | |
18 -Xmx20g will specify | |
19 20 gigs of RAM, and -Xmx200m will specify 200 megs. The max | |
20 is typically 85% of physical memory. | |
21 -eoom This flag will cause the process to exit if an out-of-memory | |
22 exception occurs. Requires Java 8u92+. | |
23 -da Disable assertions. | |
24 | |
25 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems. | |
26 " | |
27 } | |
28 | |
29 #This block allows symlinked shellscripts to correctly set classpath. | |
30 pushd . > /dev/null | |
31 DIR="${BASH_SOURCE[0]}" | |
32 while [ -h "$DIR" ]; do | |
33 cd "$(dirname "$DIR")" | |
34 DIR="$(readlink "$(basename "$DIR")")" | |
35 done | |
36 cd "$(dirname "$DIR")" | |
37 DIR="$(pwd)/" | |
38 popd > /dev/null | |
39 | |
40 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" | |
41 CP="$DIR""current/" | |
42 | |
43 z="-Xmx2g" | |
44 z2="-Xms2g" | |
45 set=0 | |
46 | |
47 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then | |
48 usage | |
49 exit | |
50 fi | |
51 | |
52 calcXmx () { | |
53 source "$DIR""/calcmem.sh" | |
54 setEnvironment | |
55 parseXmx "$@" | |
56 if [[ $set == 1 ]]; then | |
57 return | |
58 fi | |
59 freeRam 2000m 84 | |
60 z="-Xmx${RAM}m" | |
61 z2="-Xms${RAM}m" | |
62 } | |
63 calcXmx "$@" | |
64 | |
65 testmem() { | |
66 local CMD="java $EA $EOOM $z $z2 -cp $CP driver.LoadReads $@" | |
67 echo $CMD >&2 | |
68 eval $CMD | |
69 } | |
70 | |
71 testmem "$@" |