Mercurial > hg > aimc
view experiments/scripts/cnbh-syllables/feature_generation/run_aimcopy.sh @ 218:42d66bfbd9c8
- We'll get there in the end
author | tomwalters |
---|---|
date | Tue, 14 Sep 2010 01:14:54 +0000 |
parents | d961cc31ef69 |
children | 97d0f6765763 |
line wrap: on
line source
#!/bin/bash # Test for the existence of AIMCopy in the path AIMCOPY=`which AIMCopy` if [ "$AIMCOPY" == "" ]; then echo "Please build AIM-C and make AIMCopy available in the path" fi set -e set -u FEATURES_DIR=$1 MACHINE_CORES=$2 FILE_LIST=feature_generation_script echo "Splitting data files over cores..." total_cores=$(($MACHINE_CORES)) echo -n $total_cores echo " cores available" total_files=`cat $FEATURES_DIR/$FILE_LIST | wc -l | sed 's/ *//'` echo -n $total_files echo " files to process" files_per_core=$(($total_files/$total_cores+1)) echo -n $files_per_core echo " files per core" split -l $files_per_core $FEATURES_DIR/$FILE_LIST $FEATURES_DIR/split_list splits=( $(ls $FEATURES_DIR/split_list*)) element=0 echo -n "Spawning " echo -n $total_cores echo " tasks..." for ((c=1;c<=$MACHINE_CORES;c+=1)); do s=${splits[$element]} AIMCopy -D $FEATURES_DIR/aimcopy_config.out -S $s & let element=element+1 done echo "Waiting for tasks to complete..." wait echo "Done!"