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

single directional message transmit in parallel model

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 6, 2009, 03:29
Default single directional message transmit in parallel model
  #1
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 10
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Dear Foamer

I am new to parallel programming. Mybe my problem is easy for you. Would you mind giving me some suggestion?

I want to transmit some data from processor A to B, but B doesn't know there will some message coming from A. How can B received the message from A?
B may not transmit message to A. I mean the massage transmission is single directional.

I figured out a possible solution. In my question, once the message passages are established, they won't change at later time. Thus I think it better to construct the connection between A and B firstly, and transmit the message continuously at later time. To construct such a message passage beforehand, the connection of the current processor with interacting processors is broadcast, and in the destination processor the connection was constructed based on the message received.
In this method, all the processors will broadcast the connection once. How can I achieve this with OpenFOAM?

Mybe my method is a little awkward, would you mind giving me some good soultion or suggestions to this problem.

A critical problem is I don't knew how to broad a message to all the processors with current processors. Scatter? CombineScatter? combineScatterList?

Any suggestions?


Best Regards, Junwei.
su_junwei is offline   Reply With Quote

Old   December 17, 2009, 08:00
Default
  #2
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 8
herbert is on a distinguished road
You have to implement both, sending and recieving. The orders you need are:

For sending a scalar named "value" to processor n:
OPstream::write(Pstream::scheduled, n, reinterpret_cast<const char*>(&value), sizeof(scalar));

and for recieving a scalar from processor n, that should be stored in "value":
IPstream::read(Pstream::scheduled, n, reinterpret_cast<char*>(&value), sizeof(scalar));

Of course, these commands are to be executed by special processors, so first check the processor number using Pstream::myProcNo().

Hope this was helpfull
Herbert
herbert is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFX domain error message about multiphase model Jane CFX 0 March 5, 2009 11:30
User fortran error when running CFX-10 in parallel CFDworker CFX 2 October 26, 2007 16:01
Error message in CFX-10 CFDworker CFX 2 October 12, 2007 07:23
Single v.s. double precision Confused CFX 9 April 19, 2004 18:33
interface warning message when running parallel Kang FLUENT 3 November 23, 2001 05:32


All times are GMT -4. The time now is 04:16.