CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Basic Parallel Communication Issues

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2009, 23:14
Default Basic Parallel Communication Issues
  #1
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
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
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   July 6, 2009, 23:25
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
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).
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic rules for mesh partition for parallel runs hsieh OpenFOAM Running, Solving & CFD 1 December 24, 2006 12:07
basic rules for partition domain for parallel run phsieh2005 Main CFD Forum 19 September 18, 2006 10:34
Windows 64-bit, Distributed Parallel Run Issues... Erich CFX 3 March 28, 2006 17:36
boundary layer simulation : basic issues amol palekar Main CFD Forum 0 July 27, 2004 19:22
Parallel Computing Classes at San Diego Supercomputer Center Jan. 20-22 Amitava Majumdar Main CFD Forum 0 January 5, 1999 13:00


All times are GMT -4. The time now is 19:14.