<div dir="ltr">Hi Chris,<div><br></div><div>That's funny, I was using just one core thread and it was still segfaulting in pcal (but only on the RPI, not x86_64).</div><div><br></div><div>Let me know when you merge and I will test it.</div><div><br></div><div>With diffDiFX, the difference is usually at the 1e-5-6 level between x86_64 architectures (so I think I usually have the threshold at a few times 1e-5), but I have seen it be more the 1e-4 level for one specific Intel chipset vs the rest.  A few times 1e-4 is getting pretty large.  As long as it is zero mean though, it shouldn't really matter.<br><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Adam</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 5:43 AM,  <span dir="ltr"><<a href="mailto:Chris.Phillips@csiro.au" target="_blank">Chris.Phillips@csiro.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hi Adam
<div><br>
</div>
<div>I think your problem with Pcal and Generic mpifxcorr is that FFTW is not thread safe for anything other than plan execution. I had the same problem with the IPP9 branch with more than 1 Core thread. I have added some mutexes and it runs fine now. </div>
<div><br>
</div>
<div>I will merge my changes soon (end of week?) and it would be good to see if you can run it then.</div>
<div><br>
</div>
<div>Note I have a Raspberry Pi2 - it would be interesting to see how much faster it is.</div>
<div><br>
</div>
<div>Cheers</div><span class="HOEnZb"><font color="#888888">
<div>Chris</div>
<div><br>
</div>
<div><br>
</div>
</font></span><div><br>
<div><span class="">
<div>On 31 Dec 2015, at 8:14 am, Adam Deller <<a href="mailto:deller@astron.nl" target="_blank">deller@astron.nl</a>> wrote:</div>
<br>
</span><div><div class="h5"><blockquote type="cite">
<div dir="ltr">Hi everyone,
<div><br>
</div>
<div>As a fun little holiday project I decided to get DiFX compiled and running on my raspberry pi.  That was mostly pretty easy, except that it appears there was a bug in the allocation of the buffers for the generic (FFTW) FFT routines in mpifxcorr (it created
 an FFT which was twice as long as it should have been).  IPP wasn't an option, for obvious reasons.  The bug was a little hard to track down, because it turns out valgrind is known to give spurious errors about memcpy on the raspberry pi, which threw me off
 the track because it was indeed the memcpy in the generic FFT routine where the segfault occurred.  I have checked in an update to trunk mpifxcorr.  Perhaps one of either Richard or Chris (who are the people who did the majority of the generic implementation,
 if I remember right) might like to check to see that they agree.  I left the 2D FFT untouched since I don't know about its usage, but I suspect that might need to be changed in the same way in
<a href="http://architecture.h.in/" target="_blank">architecture.h.in</a> as my change for the 1D FFTs.</div>
<div><br>
</div>
<div>There remains a problem causing a segfault somewhere in the pcal handling, but unlike the FFT problem this doesn't give any valgrind errors on x86_64 architectures, so I haven't been able to track that down yet.  And I could bypass it by disabling pcal,
 so I did.</div>
<div><br>
</div>
<div>For those who are interested, an old raspberry PI B+ can correlate an aggregate input bandwidth of 0.05 MHz in real time (while it is also doing all the FxManager and DataStream tasks), which is 600x slower than a single Intel Xeon E5-2620 core @ 2.40GHz. 
 That's a worst-case comparison, since that single Intel core wasn't doing anything else.  Even burdened so, the raspberry Pi is still faster than the very first VLBI correlator, which ran on an IBM 360 costing upwards of 2 million of todays dollars. You'd
 only need something approaching 100,000 raspberry pis for a system capable of correlating the VLBA @ 2 Gbps (plus, I suppose, a pretty expensive switch).</div>
<div>
<div><br>
</div>
<div>For anyone who wishes to also run very slow correlations on $20 hardware, here is the recipe for getting DiFX compiled on a vanilla raspbian install:</div>
<div><br>
</div>
<div>
<div>svn co <a href="https://svn.atnf.csiro.au/difx/master_tags/DiFX-2.4" target="_blank">https://svn.atnf.csiro.au/difx/master_tags/DiFX-2.4</a> --username YourUsername</div>
<div># Edit DiFX-2.4/setup.bash appropriately, add it to ~/.bashrc, and source it</div>
<div># Create and chmod runmpifxcorr.DiFX-2.4.1, and added the directory containing it to $PATH</div>
<div>sudo apt-get install subversion</div>
<div>sudo apt-get install openmpi-bin</div>
<div>sudo apt-get install openmpi-dev</div>
<div>sudo apt-get install autotools</div>
<div>sudo apt-get install autotools-dev</div>
<div>sudo apt-get install autoconf</div>
<div>sudo apt-get install libtool</div>
<div>sudo apt-get install gfortran</div>
<div>sudo apt-get install expat</div>
<div>sudo apt-get install libexpat1-dev</div>
<div>sudo apt-get install  fftw3-dev </div>
<div>sudo apt-get install bison</div>
<div>sudo apt-get install flex</div>
<div>cd DiFX-2.4 ; ./install-difx --noipp</div>
<div>sudo rpcbind</div>
<div>sudo $DIFXROOT/bin/startCalcServer</div>
<div># I used a cutdown version of the rdv70 dataset to test, I can send the v2d file on request</div>
<div>vex2difx pi.v2d</div>
<div>calcif2 pi_1.calc</div>
<div># Manually generated pi_1.threads and pi_1.machines, which I can also send on request</div>
<div>startdifx -n pi_1.input</div>
</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Adam</div>
<div><br>
</div>
-- <br>
<div>
<div dir="ltr">
<div dir="ltr">!=============================================================!<br>
Dr. Adam Deller         </div>
<div dir="ltr">Ph  <a href="tel:%2B31%20521595785" value="+31521595785" target="_blank">+31 521595785</a> / Fax <span style="font-size:12.8px"><a href="tel:%2B31%20521595101" value="+31521595101" target="_blank">+31 521595101</a></span><br>
Staff Astronomer, Astronomy Group    <br>
ASTRON, Oude Hoogeveensedijk 4<br>
7991 PD Dwingeloo, The Netherlands<br>
!=============================================================!</div>
</div>
</div>
</div>
</div>
</blockquote>
</div></div></div>
<br>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">!=============================================================!<br>Dr. Adam Deller         </div><div dir="ltr">Ph  +31 521595785 / Fax <span style="font-size:12.8000001907349px">+31 521595101</span><br>Staff Astronomer, Astronomy Group    <br>ASTRON, Oude Hoogeveensedijk 4<br>7991 PD Dwingeloo,
The Netherlands<br>!=============================================================!</div></div></div></div>
</div></div></div>