Skip to content

Commit 20b009d

Browse files
committed
Modify the time check message (not "fail")
use bc -l flag to use fractions as well
1 parent 004cafd commit 20b009d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

recon_surf/functions.sh

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11

22
# set the binpath variable
3-
if [ -z "$FASTSURFER_HOME" ]
4-
then
5-
binpath="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/"
6-
else
7-
binpath="$FASTSURFER_HOME/recon_surf/"
3+
if [[ -z "$FASTSURFER_HOME" ]] ; then binpath="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/"
4+
else binpath="$FASTSURFER_HOME/recon_surf/"
85
fi
96
export binpath
107

118
# fs_time command from fs60, fs72 fails in parallel mode, use local one
12-
# also check for failure (e.g. on mac it fails)
13-
timecmd="${binpath}fs_time"
14-
$timecmd echo testing &> /dev/null
15-
if [ "${PIPESTATUS[0]}" -ne 0 ] ; then
16-
echo "time command failing, not using time..."
17-
timecmd=""
9+
# also check for failure (e.g. on mac it fails, so we cannot use it there)
10+
if FSTIME_LOAD=0 "${binpath}fs_time" echo testing &> /dev/null ; then timecmd="${binpath}fs_time"
11+
else timecmd="" ; echo "INFO: Testing fs_time was not successful, not reporting per-command runtimes."
1812
fi
1913
export timecmd
14+
export LC_NUMERIC="en_US.UTF-8"
2015

2116
function check_create_subjects_dir_properties()
2217
{

recon_surf/recon-surf.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ fi # not base run
14021402
# Collect info
14031403
EndTime=$(date)
14041404
tSecEnd=$(date '+%s')
1405-
tRunHours=$(printf %6.3f "$(bc <<< "($tSecEnd - $tSecStart) / 3600")")
1405+
tRunHours=$(LC_NUMERIC="en_US.UTF-8" printf %6.3f "$(bc -l <<< "($tSecEnd - $tSecStart) / 3600")")
14061406

14071407
{
14081408
echo ""

0 commit comments

Comments
 (0)