[Barrelfish-users] Message Content Corrupted on SCC
Baumann Andrew
andrewb at inf.ethz.ch
Wed May 9 19:14:29 CEST 2012
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/20120509/5be132ea/attachment.html
More information about the Barrelfish-users
mailing list