comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/diskbench.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 March 5, 2018
7
8 Description: Benchmarks a disk with multithreaded I/O.
9
10 Usage: diskbench.sh path=<path> data=<8g> passes=<2> threads=<>
11
12 Parameters:
13 path= Location to read and write.
14 data=8g Number of bytes to process per pass.
15 threads= Number of threads to use. By default, all logical threads.
16 In RW mode the number of active threads is doubled.
17 mode=rw I/O mode:
18 r: Test read speed only.
19 w: Test write speed only.
20 rw: Test read and write speed simultaneously.
21
22 Processing parameters:
23 None yet!
24
25 Java Parameters:
26 -Xmx This will set Java's memory usage, overriding autodetection.
27 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
28 specify 200 megs. The max is typically 85% of physical memory.
29 -eoom This flag will cause the process to exit if an out-of-memory
30 exception occurs. Requires Java 8u92+.
31 -da Disable assertions.
32
33 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
34 "
35 }
36
37 #This block allows symlinked shellscripts to correctly set classpath.
38 pushd . > /dev/null
39 DIR="${BASH_SOURCE[0]}"
40 while [ -h "$DIR" ]; do
41 cd "$(dirname "$DIR")"
42 DIR="$(readlink "$(basename "$DIR")")"
43 done
44 cd "$(dirname "$DIR")"
45 DIR="$(pwd)/"
46 popd > /dev/null
47
48 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
49 CP="$DIR""current/"
50
51 z="-Xmx400m"
52 z2="-Xms400m"
53 set=0
54
55 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
56 usage
57 exit
58 fi
59
60 calcXmx () {
61 source "$DIR""/calcmem.sh"
62 setEnvironment
63 parseXmx "$@"
64 }
65 calcXmx "$@"
66
67 diskbench() {
68 local CMD="java $EA $EOOM $z $z2 -cp $CP fun.DiskBench $@"
69 echo $CMD >&2
70 eval $CMD
71 }
72
73 diskbench "$@"