<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=gb2312">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;
        mso-fareast-language:ZH-CN;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">There are no size limits to direct array transfer, however you need to ensure that the memory containing the array remains live until the message is sent. Payload
 is declared on the sender¡¯s stack, and my suspicion is that your send function returns shortly after test_msg__tx returns. You need to wait for the send continuation to run before you can release the memory for payload (e.g. make it static or put it on the
 heap).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">It¡¯s also not clear to me why you need the casts to unsigned char *.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">BTW, if you are sending large or variable arrays of bytes, you¡¯ll probably find it¡¯s more efficient to use variable-length arrays in flounder; i.e.:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">message msg(uint8 buf[len]);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Andrew<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Shi Jinghao (</span><span lang="ZH-CN" style="font-size:10.0pt">Ê·¾­ºÆ£©</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
 [mailto:jhshi@cs.hku.hk] <br>
<b>Sent:</b> Wednesday, 09 May, 2012 4:58<br>
<b>To:</b> barrelfish-users@lists.inf.ethz.ch<br>
<b>Subject:</b> [Barrelfish-users] Message Content Corrupted on SCC<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">When I'm trying to send a&nbsp;relatively&nbsp;large byte array (~800B) between core 0 and 1, I found that starting from the 3rd message, the message content is corrupted.&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Here is the flounder spec I use:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">interface test {</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">&nbsp; &nbsp; typedef uint8 payload[800];</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">&nbsp; &nbsp; message msg(payload p);</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">}</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">And here is the code snippet that I send and receive the message:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">// sender side (core 0)</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">test_payload_t payload;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">// fill payload with some magic numbers</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">for (int i = 0; i &lt; sizeof(payload); i&#43;&#43;) {</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">&nbsp; &nbsp; ((unsigned char*)payload)[i] = 0xaa;</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">}</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">test_msg__tx(b, NOP_CONT, payload);</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">// receiver side, check the message</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">for (int i = 0; i &lt; sizeof(payload); i&#43;&#43;) {</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">&nbsp; &nbsp; assert(((unsigned char*)payload)[i] == 0xaa);</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">}</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">So I was wondering whether there are any size limits of direct byte array transfer. I don't know if I should switch to bulk_transfer since about 80% of my message are of small size (&lt; 100B), but other 20% message are about 4K size. Any
 suggestions about what kind of IDC I should choose in Barrelfish?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Jinghao<o:p></o:p></p>
</div>
</div>
</body>
</html>