deepsterblue |
July 6, 2009 22:14 |
Basic Parallel Communication Issues
Hi all,
I've been trying to get my hands dirty with parallel programming in 1.5-dev; but I seem to have hit a road-block... Basically, I'm trying to perform a nonBlocking send/receive with the following code:
Code:
mySendCode
{
OPstream::write
(
Pstream::nonBlocking,
neiProcNo,
reinterpret_cast<const char*>
(
&sendLblBuffer[patchI][0]
),
sendLblBuffer[patchI].size()*sizeof(label)
);
OPstream::write
(
Pstream::nonBlocking,
neiProcNo,
reinterpret_cast<const char*>
(
&sendSclBuffer[patchI][0]
),
sendSclBuffer[patchI].size()*sizeof(scalar)
);
}
and
Code:
myReceiveCode
{
// Size the buffers
recvLblBuffer[patchI].setSize(nRecvFaces[patchI], 0);
recvSclBuffer[patchI].setSize(nRecvFaces[patchI], 0.0);
IPstream::read
(
Pstream::nonBlocking,
neiProcNo,
reinterpret_cast<char*>
(
recvLblBuffer[patchI].begin()
),
recvLblBuffer[patchI].byteSize()
);
IPstream::read
(
Pstream::nonBlocking,
neiProcNo,
reinterpret_cast<char*>
(
recvSclBuffer[patchI].begin()
),
recvSclBuffer[patchI].byteSize()
);
OPstream::waitRequests();
IPstream::waitRequests();
}
But I keep getting the following error:
Code:
[2] wrong token type - expected int found on line 0 the string "%"
[2]
[2] file: IOstream at line 0.
[2]
[2] From function operator>>(Istream&, int&)
[2] in file primitives/int/intIO.C at line 74.
Any ideas?
Thanks,
Sandeep
|