<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">To qualify my earlier statement, it would seem that from a software POV, I don’t need to care about the endian-ness of the data,
<i>provided my software decodes the raw data correctly… </i>So far I am not aware of any system in the GMN DAQ that is experiencing issues with decoding its raw data correctly… So then I agree with Ole that what we mainly want is
<i>consistency</i>, and if little-endian data is more efficient to decode on the jlab batch farm than big-endian data, then that is what we should prefer.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Andrew<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Alexandre Camsonne <camsonne@jlab.org><br>
<b>Date: </b>Sunday, October 3, 2021 at 2:22 PM<br>
<b>To: </b>Paul King <pking@jlab.org><br>
<b>Cc: </b>Andrew Puckett <puckett@jlab.org>, Robert Michaels <rom@jlab.org>, Ole Hansen <ole@jlab.org>, sbs_daq@jlab.org <sbs_daq@jlab.org><br>
<b>Subject: </b>[EXTERNAL] Re: [Sbs_daq] Big endian raw data?<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal">Everything is intel besided VTP. Though Dave mentionned VME was big endian.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Alexandre<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Sun, Oct 3, 2021, 13:56 Paul King <<a href="mailto:pking@jlab.org">pking@jlab.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:black">I can comment that when I wrote the helicity scaler library, I found that I needed to byte swap the data words (module data and diagnostic counters) on the crate in order to be decoded
correctly. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Arial",sans-serif;color:black">I'm not sure if halladaq8 is an Intel or arm cpu.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:black">Does Podd or evio2xml do a dynamic check of endianness and then byteswap, or is that explicitly enabled?
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div id="m_-188557246818857469ms-outlook-mobile-signature">
<p class="MsoNormal">Sent from my mobile device.<br>
Get <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwMFaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=UewsPL6Z06cTByi2Ms7DKw&m=ecRb_ZFdjO1bDouAI3PD56oNk9UndHy7kNrc0zOsuv4&s=ewgHMESoHSzQrk7jFRhEIxfyUyalWocksFcCBuIfhjw&e=" target="_blank">
Outlook for Android</a><o:p></o:p></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="100%" align="center">
</div>
<div id="m_-188557246818857469divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Sbs_daq <<a href="mailto:sbs_daq-bounces@jlab.org" target="_blank">sbs_daq-bounces@jlab.org</a>> on behalf of Andrew Puckett <<a href="mailto:puckett@jlab.org" target="_blank">puckett@jlab.org</a>><br>
<b>Sent:</b> Sunday, October 3, 2021 1:31:05 PM<br>
<b>To:</b> Robert Michaels <<a href="mailto:rom@jlab.org" target="_blank">rom@jlab.org</a>>; Ole Hansen <<a href="mailto:ole@jlab.org" target="_blank">ole@jlab.org</a>>;
<a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a> <<a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a>><br>
<b>Subject:</b> Re: [Sbs_daq] Big endian raw data?</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p>Interesting. So perhaps I’m being naïve here, but other than the byte-swapping inefficiency Ole pointed out in processing the raw data on the compute farm nodes, is there an actual problem here? Do we need to check/care about this in the software in writing
our raw data decoders?<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>The cause of Bradley’s crash while processing GRINCH data doesn’t necessarily seem related to this…
<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Andrew <o:p></o:p></p>
<p> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Robert Michaels <<a href="mailto:rom@jlab.org" target="_blank">rom@jlab.org</a>><br>
<b>Date: </b>Sunday, October 3, 2021 at 1:21 PM<br>
<b>To: </b>Ole Hansen <<a href="mailto:ole@jlab.org" target="_blank">ole@jlab.org</a>>, Andrew Puckett <<a href="mailto:puckett@jlab.org" target="_blank">puckett@jlab.org</a>>,
<a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a> <<a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a>><br>
<b>Subject: </b>Re: [Sbs_daq] Big endian raw data?</span><o:p></o:p></p>
</div>
<div>
<p><span style="font-size:12.0pt;color:black">I believe there are byte-swapping routines available in the DAQ libraries which allow to put the bytes in the right state and be consistent. But the DAQ expert needs to make this happen. Below is a snippet of
an email from Dave Abbott about a year ago when I was having some trouble, which I think is relevant.. Dave is a good person to ask. Can ask Bryan Moffit or Alexandre, too.</span><o:p></o:p></p>
</div>
<div>
<p><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p><span style="font-size:12.0pt;color:black">---------------------- snippet of email from Dave Abbott ------------------------</span><o:p></o:p></p>
</div>
<div>
<p><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p><span style="font-size:12.0pt;color:black;background:white">The CODA data files are written from a Java Event Builder. JAVA is inherently Big Endian. The EVIO</span><span style="font-size:12.0pt;color:black">
</span><o:p></o:p></p>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">files will be by default in big endian.</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">However, ALL Banks of User data - created in your readout list - will NOT be swapped. They will stay</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">whatever Endian it was when it was written.</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">Typically the ROC will run in Linux on Intel which is Little Endian. Therefore the Data banks you create will stay</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">little endian. However the Bank headers will be swapped to be compatible with the rest of the CODA file.</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">An even more confusing possibility is that you might do a DMA from the VME bus into a CODA data Bank.</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">The VME bus is Big endian. Therefore the data from the VME bus will stay Big endian in this bank.</span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p style="background:white"><span style="font-size:12.0pt;color:black">Our general rule for CODA 3 is that for purposes of DAQ we will not touch (or modify) the User's data in any way.</span><o:p></o:p></p>
</div>
<p><span style="font-size:12.0pt;color:black;background:white">We will only modify the EVIO headers to match the endianess of whatever System writes the file.</span><o:p></o:p></p>
</div>
<div>
<div>
<p><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div id="m_-188557246818857469x_Signature">
<div>
<div id="m_-188557246818857469x_divtagdefaultwrapper">
<p><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="100%" align="center">
</div>
<div id="m_-188557246818857469x_divRplyFwdMsg">
<p><b><span style="color:black">From:</span></b><span style="color:black"> Sbs_daq <<a href="mailto:sbs_daq-bounces@jlab.org" target="_blank">sbs_daq-bounces@jlab.org</a>> on behalf of Ole Hansen <<a href="mailto:ole@jlab.org" target="_blank">ole@jlab.org</a>><br>
<b>Sent:</b> Sunday, October 3, 2021 1:06 PM<br>
<b>To:</b> Andrew Puckett <<a href="mailto:puckett@jlab.org" target="_blank">puckett@jlab.org</a>>;
<a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a> <<a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a>><br>
<b>Subject:</b> Re: [Sbs_daq] Big endian raw data?</span> <o:p></o:p></p>
<div>
<p> <o:p></o:p></p>
</div>
</div>
<div>
<p style="margin-bottom:12.0pt">Maybe our various front-ends differ in endianness, so we write mixed-endian data?!? That would be disastrous since it is not supported by EVIO. A file can only be one or the other—a very binary view. (I guess EVIO was written
before we became diversity-aware ;) ).<br>
<br>
Ole<o:p></o:p></p>
<div>
<p>On 3.10.21 at 13:03, Andrew Puckett wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p>Hi Ole, <o:p></o:p></p>
<p> <o:p></o:p></p>
<p>This is interesting. The GRINCH data are being read out by the new VETROC modules, I don’t know if they differ from the other modules in terms of “endian-ness”. Maybe a DAQ expert can weigh in here?<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Andrew <o:p></o:p></p>
<p> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Sbs_daq <a href="mailto:sbs_daq-bounces@jlab.org" target="_blank">
<sbs_daq-bounces@jlab.org></a> on behalf of Ole Hansen <a href="mailto:ole@jlab.org" target="_blank">
<ole@jlab.org></a><br>
<b>Date: </b>Sunday, October 3, 2021 at 1:00 PM<br>
<b>To: </b><a href="mailto:sbs_daq@jlab.org" target="_blank">sbs_daq@jlab.org</a>
<a href="mailto:sbs_daq@jlab.org" target="_blank"><sbs_daq@jlab.org></a><br>
<b>Subject: </b>[Sbs_daq] Big endian raw data?</span><o:p></o:p></p>
</div>
<p style="margin-bottom:12.0pt">Hi guys,<br>
<br>
Bradley reported a crash of the replay (actually in EVIO) with /adaq1/data1/sbs/grinch_72.evio.0 (see
<a href="https://logbooks.jlab.org/entry/3916105" target="_blank">https://logbooks.jlab.org/entry/3916105</a>).<br>
<br>
When digging into the cause of this crash, I discovered that these raw data are written in big-endian format. How can this be? I thought the front-ends are Intel processors. Are we taking data with ARM chips that are configured for big-endian mode? Is this
a mistake, or is there some plan to it?<br>
<br>
These big-endian data have to be byte-swapped when processing them on x86, which is what all our compute nodes run. That's a LOT of work. It leads to significant and seemingly completely unnecessary overhead. I.e. we're burning CPU cycles for nothing good,
it seems.<br>
<br>
Please explain.<br>
<br>
Ole<o:p></o:p></p>
</div>
</blockquote>
<p> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Sbs_daq mailing list<br>
<a href="mailto:Sbs_daq@jlab.org" target="_blank">Sbs_daq@jlab.org</a><br>
<a href="https://mailman.jlab.org/mailman/listinfo/sbs_daq" target="_blank">https://mailman.jlab.org/mailman/listinfo/sbs_daq</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>