forked from cesare-corrado/meshtools3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerM3D.sh
More file actions
42 lines (36 loc) · 1.41 KB
/
dockerM3D.sh
File metadata and controls
42 lines (36 loc) · 1.41 KB
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
#!/bin/bash
#
# File used to run meshtools3d from a docker container, with multi core support
#
if [ -z "$1" ]
then
echo "[MeshTools3D]: No argument supplied, to run, try"
echo ""
echo "docker run --rm --volume=/path/to/data:/data cemrg/meshtools3d [NUM_PROCESSORS | -a] [ARGS]"
echo " Set NUM_PROCESSORS to the number of cores you want to use "
echo " (dependant on he cores you allow docker to use)"
echo " If NUM_PROCESSORS = -a then the container tries to detect the number of processors."
echo ""
echo "[MeshTools3D] help: "
echo ""
/installs/meshtools3D_build/meshtools3d -h
exit 1
fi
if [[ "$1" =~ .*"-f".* ]]; then
# my_TBB_NUM_THREADS=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
my_TBB_NUM_THREADS=$(nproc)
echo "[MeshTools3D] Number of cores detected in system: ${my_TBB_NUM_THREADS}"
export TBB_NUM_THREADS=${my_TBB_NUM_THREADS}
/installs/meshtools3D_build/meshtools3d "$@"
exit 0
fi
if [[ "$1" =~ .*"-a".* ]]; then
# my_TBB_NUM_THREADS=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
my_TBB_NUM_THREADS=$(nproc)
echo "[MeshTools3D] Number of cores detected in system: ${my_TBB_NUM_THREADS}"
else
my_TBB_NUM_THREADS=$1
echo "[MeshTools3D] Number of cores set by user: ${my_TBB_NUM_THREADS}"
fi
export TBB_NUM_THREADS=${my_TBB_NUM_THREADS}
/installs/meshtools3D_build/meshtools3d "${@:2}"