annotate experiments/scripts/cnbh-syllables/feature_generation/run_aimcopy.sh @ 249:90181ab320f0

- Scripts for plotting summary performance graphs.
author tomwalters
date Mon, 01 Nov 2010 00:31:00 +0000
parents 587ab0b1f062
children
rev   line source
tomwalters@54 1 #!/bin/bash
tomwalters@54 2
tomwalters@54 3 # Test for the existence of AIMCopy in the path
tomwalters@54 4 AIMCOPY=`which AIMCopy`
tomwalters@183 5 if [ "$AIMCOPY" == "" ]; then
tomwalters@54 6 echo "Please build AIM-C and make AIMCopy available in the path"
tomwalters@241 7 exit -1
tomwalters@54 8 fi
tomwalters@54 9
tomwalters@54 10 set -e
tomwalters@54 11 set -u
tomwalters@54 12
tomwalters@239 13 AIMCOPY_CONFIGURATION_FILE=$1
tomwalters@239 14 FEATURES_DIR=$2
tomwalters@239 15 MACHINE_CORES=$3
tomwalters@54 16 FILE_LIST=feature_generation_script
tomwalters@54 17
tomwalters@54 18 echo "Splitting data files over cores..."
tomwalters@54 19 total_cores=$(($MACHINE_CORES))
tomwalters@54 20 echo -n $total_cores
tomwalters@54 21 echo " cores available"
tomwalters@54 22 total_files=`cat $FEATURES_DIR/$FILE_LIST | wc -l | sed 's/ *//'`
tomwalters@54 23 echo -n $total_files
tomwalters@54 24 echo " files to process"
tomwalters@54 25 files_per_core=$(($total_files/$total_cores+1))
tomwalters@54 26 echo -n $files_per_core
tomwalters@54 27 echo " files per core"
tomwalters@54 28 split -l $files_per_core $FEATURES_DIR/$FILE_LIST $FEATURES_DIR/split_list
tomwalters@54 29 splits=( $(ls $FEATURES_DIR/split_list*))
tomwalters@54 30 element=0
tomwalters@54 31 echo -n "Spawning "
tomwalters@54 32 echo -n $total_cores
tomwalters@54 33 echo " tasks..."
tomwalters@54 34 for ((c=1;c<=$MACHINE_CORES;c+=1)); do
tomwalters@54 35 s=${splits[$element]}
tomwalters@241 36 AIMCopy -C $AIMCOPY_CONFIGURATION_FILE -D $FEATURES_DIR/aimcopy_config.out -S $s -G $FEATURES_DIR/aimcopy_graph.dot &
tomwalters@54 37 let element=element+1
tomwalters@54 38 done
tomwalters@54 39
tomwalters@54 40 echo "Waiting for tasks to complete..."
tomwalters@54 41 wait
tomwalters@54 42 echo "Done!"