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

single directional message transmit in parallel model

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

Like Tree1Likes
  • 1 Post By herbert

Reply
 
LinkBack Thread Tools Search this Thread 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: 20
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: 17
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
wstapel likes this.
herbert is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single v.s. double precision Confused CFX 15 November 10, 2016 05:42
User fortran error when running CFX-10 in parallel CFDworker CFX 3 September 22, 2015 09:59
CFX domain error message about multiphase model Jane CFX 0 March 5, 2009 11:30
Error message in CFX-10 CFDworker CFX 2 October 12, 2007 08:23
interface warning message when running parallel Kang FLUENT 3 November 23, 2001 05:32


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