<?xml version="1.0" encoding="UTF-8"?>
<simulation xmds-version="2">
  <testing>
    <command_line>mpirun -n 8 ./mpi_dft_small</command_line>
    <xsil_file name="mpi_dft_small_xspace1.xsil" expected="mpi_dft_small_xspace_expected.xsil" absolute_tolerance="1e-7" relative_tolerance="1e-5" />
    <xsil_file name="mpi_dft_small_kspace.xsil"  expected="mpi_dft_small_kspace_expected.xsil" absolute_tolerance="1e-7" relative_tolerance="1e-5" />
    <xsil_file name="mpi_dft_small_kspace2.xsil" expected="mpi_dft_small_kspace2_expected.xsil" absolute_tolerance="1e-7" relative_tolerance="1e-5" />
    <xsil_file name="mpi_dft_small_xspace2.xsil" expected="mpi_dft_small_xspace_expected.xsil" absolute_tolerance="1e-7" relative_tolerance="1e-5" />
  </testing>
  
  
  <name>mpi_dft_small</name>
  <author>Graham Dennis</author>
  <description>
    Test of the fourier transforms using MPI.
    
    Checking that when the number of processors is of the same order as the number of grid points that things don't go awry
  </description>
  
  <features>
    <benchmark />
    <bing />
    <fftw plan="patient" />
    <openmp />
    <globals>
      <![CDATA[
      const real T = 10.0;
      const real mass = 1e-3;
      const real length = 1.0;
      const real mu = mass/length;
      
      const real width = 0.1;
      const real absorb = 80.0;
      ]]>
    </globals>
  </features>
  
  <geometry>
    <propagation_dimension> t </propagation_dimension>
    <transverse_dimensions>
      <dimension name="x" lattice="10"  domain="(-1, 1)" />
      <dimension name="y" lattice="10"  domain="(-1, 1)" />
    </transverse_dimensions>
  </geometry>
  
  <driver name="distributed-mpi" />
  
  <vector name="main" initial_basis="x y" type="complex">
    <components>
      u
    </components>
    <initialisation>
      <![CDATA[
        u = exp(-100.0*((x-0.5)*(x-0.5) + y*y));
      ]]>
    </initialisation>
  </vector>
  
  <sequence>
    <breakpoint filename="mpi_dft_small_xspace1.xsil">
      <dependencies>main</dependencies>
    </breakpoint>
    <breakpoint filename="mpi_dft_small_kspace.xsil">
      <dependencies basis="ky kx">main</dependencies>
    </breakpoint>
    <breakpoint filename="mpi_dft_small_kspace2.xsil">
      <dependencies basis="ky x">main</dependencies>
    </breakpoint>
    <breakpoint filename="mpi_dft_small_xspace2.xsil">
      <dependencies basis="y x">main</dependencies>
    </breakpoint>
  </sequence>
  <output format="binary">
  </output>

<info>
Script compiled with XMDS2 version VERSION_PLACEHOLDER (SUBVERSION_REVISION_PLACEHOLDER)
See http://www.xmds.org for more information.
</info>

<XSIL Name="breakpoint">
  <Param Name="n_independent">2</Param>
  <Array Name="variables" Type="Text">
    <Dim>4</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
kx ky uR uI 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>10</Dim>
    <Dim>10</Dim>
    <Dim>4</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint64" precision="double" Type="Remote" Encoding="LittleEndian"/>
mpi_dft_small_kspace_expected.dat
    </Stream>
  </Array>
</XSIL>
</simulation>
