Mercurial > hg > aimc
annotate trunk/experiments/scripts/cnbh-syllables/feature_generation/run_aimcopy.sh @ 335:71c438f9daf7
- Scripts for running recognition experiments using AIM-C and HTK to compare MFCCs against features generated with AIM-C
author | tomwalters |
---|---|
date | Wed, 04 Aug 2010 06:41:56 +0000 |
parents | |
children | 683df686f40d |
rev | line source |
---|---|
tomwalters@335 | 1 #!/bin/bash |
tomwalters@335 | 2 |
tomwalters@335 | 3 # Test for the existence of AIMCopy in the path |
tomwalters@335 | 4 AIMCOPY=`which AIMCopy` |
tomwalters@335 | 5 if [ $AIMCOPY == "" ]; then |
tomwalters@335 | 6 echo "Please build AIM-C and make AIMCopy available in the path" |
tomwalters@335 | 7 fi |
tomwalters@335 | 8 |
tomwalters@335 | 9 set -e |
tomwalters@335 | 10 set -u |
tomwalters@335 | 11 |
tomwalters@335 | 12 FEATURES_DIR=$1 |
tomwalters@335 | 13 MACHINE_CORES=$2 |
tomwalters@335 | 14 FILE_LIST=feature_generation_script |
tomwalters@335 | 15 |
tomwalters@335 | 16 echo "Splitting data files over cores..." |
tomwalters@335 | 17 total_cores=$(($MACHINE_CORES)) |
tomwalters@335 | 18 echo -n $total_cores |
tomwalters@335 | 19 echo " cores available" |
tomwalters@335 | 20 total_files=`cat $FEATURES_DIR/$FILE_LIST | wc -l | sed 's/ *//'` |
tomwalters@335 | 21 echo -n $total_files |
tomwalters@335 | 22 echo " files to process" |
tomwalters@335 | 23 files_per_core=$(($total_files/$total_cores+1)) |
tomwalters@335 | 24 echo -n $files_per_core |
tomwalters@335 | 25 echo " files per core" |
tomwalters@335 | 26 split -l $files_per_core $FEATURES_DIR/$FILE_LIST $FEATURES_DIR/split_list |
tomwalters@335 | 27 splits=( $(ls $FEATURES_DIR/split_list*)) |
tomwalters@335 | 28 element=0 |
tomwalters@335 | 29 echo -n "Spawning " |
tomwalters@335 | 30 echo -n $total_cores |
tomwalters@335 | 31 echo " tasks..." |
tomwalters@335 | 32 for ((c=1;c<=$MACHINE_CORES;c+=1)); do |
tomwalters@335 | 33 s=${splits[$element]} |
tomwalters@335 | 34 AIMCopy -D $FEATURES_DIR/aimcopy_config.out -S $s & |
tomwalters@335 | 35 let element=element+1 |
tomwalters@335 | 36 done |
tomwalters@335 | 37 |
tomwalters@335 | 38 echo "Waiting for tasks to complete..." |
tomwalters@335 | 39 wait |
tomwalters@335 | 40 echo "Done!" |