#!/bin/sh

# This is a re-analysis of the Speech Prosody abstract,
# in the light of our discovery that the individual variablility
# and the text-to-text variability are large.

# The basic analysis involves predicting acoustic properties
# from nearby acoustic properties.

mkdir r_poetry r_prose
t=/tmp/m4_$$.sub
trap "rm -f $t" EXIT

mkdir logs

cat <<"ENDEND" >$t
Universe   = vanilla
Input      = /dev/null
request_cpus = 4
Interpreter = /usr/bin/python
Executable = /proj/condor/bin/blcr_wrapper.sh
CheckpointFreq = 120
# JobOutput = preplog/Exp_dot_analysis.$(Cluster).$(Process)
CheckpointID = $$([MY.GlobalJobID])
+ScriptName = "$(Script)"
+JobName = "BLCR $(Script)"
Arguments  = $(JobOutput) $(CheckpointFreq) $(CheckpointID) $(Interpreter) $(Script) $(ScriptArgs)

Getenv = True
JobOutput = logs/model4.$(Cluster).$(Process)
Output     = logs/model4.$(Cluster).$(Process).blcr.out
Error      = logs/model4.$(Cluster).$(Process).blcr.err
Log        = logs/model4.$(Cluster)..log
Script = model4.py
ENDEND

for m in C V
do
  for dir in 0 1 -1
  do
    for lang in French Chinese Russian Greek English
    do
      for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
      do
lfs=$(echo ../../proc/metadata/${lang}_*.fiat)
cat <<ENDEND >>$t

ScriptArgs = -mapM $m -o r_poetry/$lang${m}_${i}_${dir}_${s} -dir $dir -poetry $lfs
Queue

ScriptArgs = -mapM $m -o r_prose/$lang${m}_${i}_${dir}_${s} -dir $dir -prose $lfs
Queue
ENDEND
      done
    done
  done
done
condor_submit -v $t
