[Barrelfish-users] Message Content Corrupted on SCC

Shi Jinghao (史经浩) jhshi at cs.hku.hk
Thu May 10 09:55:40 CEST 2012


Hi, Andrew.

Thanks for your helpful reply! Yes indeed, I thought the underlying send
function would keep a separate copy of the message, so I just allocate the
payload on stack. I guess that's why the message content is corrupted.

I've fixed this bug and now got not message corruption! :-)

FYI, I also composed a bulk transfer version of my comm module. I found he
bulk_bench (/usr/bench/bulk_bench) example is very helpful. Also, for those
who want to try bulk_transfer on SCC, I'd like to remind that we must map
the shared mem as VREGION_FLAGS_READ_WRITE_MPB since there are no cache
coherence, otherwise, we may read some stale data.

I also find the variable size array transfer you mentioned very interesting
and seems exactly what I'm looking for. I'll also try that later.

Thanks,
Jinghao

On Thu, May 10, 2012 at 1:14 AM, Baumann Andrew <andrewb at inf.ethz.ch> wrote:

>  Hi,****
>
> ** **
>
> 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).****
>
> ** **
>
> It’s also not clear to me why you need the casts to unsigned char *.****
>
> ** **
>
> 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.:*
> ***
>
> message msg(uint8 buf[len]);****
>
> ** **
>
> Cheers,****
>
> Andrew****
>
> ** **
>
> *From:* Shi Jinghao (史经浩) [mailto:jhshi at cs.hku.hk]
> *Sent:* Wednesday, 09 May, 2012 4:58
> *To:* barrelfish-users at lists.inf.ethz.ch
> *Subject:* [Barrelfish-users] Message Content Corrupted on SCC****
>
> ** **
>
> Hi,****
>
> ** **
>
> When I'm trying to send a relatively large byte array (~800B) between core
> 0 and 1, I found that starting from the 3rd message, the message content is
> corrupted. ****
>
> ** **
>
> Here is the flounder spec I use:****
>
> ** **
>
> interface test {****
>
>     typedef uint8 payload[800];****
>
> ** **
>
>     message msg(payload p);****
>
> }****
>
> ** **
>
> And here is the code snippet that I send and receive the message:****
>
> ** **
>
> // sender side (core 0)****
>
> test_payload_t payload;****
>
> // fill payload with some magic numbers****
>
> for (int i = 0; i < sizeof(payload); i++) {****
>
>     ((unsigned char*)payload)[i] = 0xaa;****
>
> }****
>
> test_msg__tx(b, NOP_CONT, payload);****
>
> ** **
>
> // receiver side, check the message****
>
> for (int i = 0; i < sizeof(payload); i++) {****
>
>     assert(((unsigned char*)payload)[i] == 0xaa);****
>
> }****
>
> ** **
>
> 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 (< 100B), but other 20% message are about
> 4K size. Any suggestions about what kind of IDC I should choose in
> Barrelfish?****
>
> ** **
>
> Thanks,****
>
> Jinghao****
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20120510/62f7d93f/attachment-0001.html 


More information about the Barrelfish-users mailing list