CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Basic Parallel Communication Issues (https://www.cfd-online.com/Forums/openfoam-programming-development/66132-basic-parallel-communication-issues.html)

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

deepsterblue July 6, 2009 22:25

Oops... Sorry folks. That was a bug on my part. You'll notice that the error actually refers to intIO.C. (Which was due to an earlier blocking send/receive).


All times are GMT -4. The time now is 13:07.