| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified March 15, 2016 |
| 7 | |
| 8 | Description: Reformats output from a script. |
| 9 | Made for generating the BBMerge paper data. |
| 10 | |
| 11 | Usage: processfrags.sh <file> |
| 12 | |
| 13 | Processing parameters: |
| 14 | None yet! |
| 15 | |
| 16 | Java Parameters: |
| 17 | -Xmx This will set Java's memory usage, overriding autodetection. |
| 18 | -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will |
| 19 | specify 200 megs. The max is typically 85% of physical memory. |
| 20 | -eoom This flag will cause the process to exit if an out-of-memory |
| 21 | exception occurs. Requires Java 8u92+. |
| 22 | -da Disable assertions. |
| 23 | |
| 24 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 25 | " |
| 26 | } |
| 27 | |
| 28 | #This block allows symlinked shellscripts to correctly set classpath. |
| 29 | pushd . > /dev/null |
| 30 | DIR="${BASH_SOURCE[0]}" |
| 31 | while [ -h "$DIR" ]; do |
| 32 | cd "$(dirname "$DIR")" |
| 33 | DIR="$(readlink "$(basename "$DIR")")" |
| 34 | done |
| 35 | cd "$(dirname "$DIR")" |
| 36 | DIR="$(pwd)/" |
| 37 | popd > /dev/null |
| 38 | |
| 39 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 40 | CP="$DIR""current/" |
| 41 | |
| 42 | z="-Xmx100m" |
| 43 | z2="-Xms100m" |
| 44 | set=0 |
| 45 | |
| 46 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 47 | usage |
| 48 | exit |
| 49 | fi |
| 50 | |
| 51 | calcXmx () { |
| 52 | source "$DIR""/calcmem.sh" |
| 53 | setEnvironment |
| 54 | parseXmx "$@" |
| 55 | } |
| 56 | calcXmx "$@" |
| 57 | |
| 58 | processfrags() { |
| 59 | local CMD="java $EA $EOOM $z -cp $CP driver.ProcessFragMerging $@" |
| 60 | echo $CMD >&2 |
| 61 | eval $CMD |
| 62 | } |
| 63 | |
| 64 | processfrags "$@" |