<preparation>

<!-- ******************************************************************************** -->

<prepare cname="QCD_Prepare">

  <input files="input/kernel_A.input.in
                input/kernel_B.input.parameters.in
		input/kernel_B.input.status.in
		input/kernel_B.input.beta.in
		input/kernel_D.input.in
		input/kernel_E.input.in
		run/collectData.sh.in" />

  <!-- kernel A input files -->
  <substitute infile="kernel_A.input.in" outfile="kernel_A.input">
    <sub from="#KA_LATTICE#"   to="$KA_NX $KA_NY $KA_NZ $KA_NT"   />
    <sub from="#KA_PROCESSES#" to="$KA_PX $KA_PY $KA_PZ $KA_PT" />
    <sub from="#KA_MAXITER#"   to="$KA_MAXITER"   />
  </substitute>

  <!-- kernel B input files -->
  <substitute infile="kernel_B.input.parameters.in" outfile="kernel_B.input.parameters">
    <sub from="#KB_NX#" to="$KB_NX"   />
    <sub from="#KB_NY#" to="$KB_NY" />
    <sub from="#KB_NZ#" to="$KB_NZ"   />
  </substitute>

  <substitute infile="kernel_B.input.status.in" outfile="kernel_B.input.status">
    <sub from="#KB_MAXITER#" to="$KB_MAXITER"   />
  </substitute>

  <substitute infile="kernel_B.input.beta.in" outfile="kernel_B.input.beta">
    <sub from="#KB_MAXITER#" to="$KB_MAXITER"   />
  </substitute>

  <!-- kernel D input files -->
  <substitute infile="kernel_D.input.in" outfile="kernel_D.input">
    <sub from="#KD_L#"    to="$KD_L"   />
    <sub from="#KD_T#"    to="$KD_T"   />
    <sub from="#KD_NP_X#" to="$KD_PX"   />
    <sub from="#KD_NP_Y#" to="$KD_PY"   />
    <sub from="#KD_NP_Z#" to="$KD_PZ"   />
  </substitute>

  <!-- kernel E input files -->
  <substitute infile="kernel_E.input.in" outfile="kernel_E.input">
    <sub from="#KE_NX#"          to="$KE_NX"   />
    <sub from="#KE_NY#"          to="$KE_NY"   />
    <sub from="#KE_NZ#"          to="$KE_NZ"   />
    <sub from="#KE_NT#"          to="$KE_NT"   />
    <sub from="#KE_PROCS#"       to="$KE_PX $KE_PY $KE_PZ $KE_PT"   />
    <sub from="#KE_WILSON_MASS#" to="$KE_WILSON_MASS"   />
    <sub from="#KE_MAXITER#"     to="$KE_MAXITER"   />
  </substitute>

  
  <!-- collect and verify script -->
  <substitute infile="collectData.sh.in" outfile="collectData.sh">
    <sub from="#BENCHHOME#"           to="$benchhome" />
    <sub from="#EXECUTABLE#"          to="*.exe" />

    <sub from="#PERL#"                to="$PERL_CMD" />
    
    <sub from="#COLLECT_IHPCT_HWC#"   to="`index('$IHPCT_HWC','on')>-1     ? ' ' : '#'`" />
    <sub from="#COLLECT_IHPCT_MPITR#" to="`index('$IHPCT_MPITR','on')>-1   ? ' ' : '#'`" />
    <sub from="#COLLECT_GPROF#"       to="`index('$GPROF','on')>-1         ? ' ' : '#'`" />
    <sub from="#COLLECT_CRAYPAT#"     to="`index('$CRAYPAT','on')>-1       ? ' ' : '#'`" />
    <sub from="#JUGENE#"              to="`index('$platform','Jugene')>-1  ? ' ' : '#'`" />
    <sub from="#JUQUEEN#"             to="`index('$platform','Juqueen')>-1  ? ' ' : '#'`" />
    <sub from="#JUMP#"                to="`index('$platform','Jump')>-1    ? ' ' : '#'`" />
    <sub from="#HUYGENS#"             to="`index('$platform','Huygens')>-1 ? ' ' : '#'`" />
    <sub from="#LOUHI#"               to="`index('$platform','Louhi')>-1   ? ' ' : '#'`" />
  </substitute>

  <command></command> 

</prepare>

<!-- ******************************************************************************** -->

</preparation>



