CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

A UDF Problem in Parallel Mode

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 24, 2008, 19:52
Default A UDF Problem in Parallel Mode
  #1
Jun
Guest
 
Posts: n/a
This problem only occurs when I run it in the parallel mode on the supercomputer.

this is a test code,

#include "udf.h"

DEFINE_ADJUST(comput_mass_heat,domain) {

int i=1;

double number=2.0;

#if !RP_HOST

Thread *thrd;

cell_t c;

#endif

#if !RP_HOST

thrd=Lookup_Thread(domain,2);

begin_c_loop(c, thrd)

i=i+2;

end_c_loop(c,thrd)

number=number/i;

Message("%g\n", i);

#endif

}

I expected the output of i to be a very large integer. But the value of i remained 1.

Then I change the code like this:

#include "udf.h"

DEFINE_ADJUST(comput_mass_heat,domain) {

int i;

double number=2.0;

#if !RP_HOST

Thread *thrd;

cell_t c;

#endif

#if !RP_HOST

thrd=Lookup_Thread(domain,2);

begin_c_loop(c, thrd)

i=i+2;

end_c_loop(c,thrd)

number=number/i;

Message("%g\n", i);

#endif

}

This time, the output of i value is constantly 12.

Again

#include "udf.h"

DEFINE_ADJUST(comput_mass_heat,domain) {

int i;

double number=2.0;

#if !RP_HOST

Thread *thrd;

cell_t c;

#endif

#if !RP_HOST

thrd=Lookup_Thread(domain,2);

begin_c_loop(c, thrd)

i=2;

end_c_loop(c,thrd)

number=number/i;

Message("%g\n", i);

#endif

}

I got i=2 for the output

And for

#include "udf.h"

DEFINE_ADJUST(comput_mass_heat,domain) {

int i=1;

double number=2.0;

#if !RP_HOST

Thread *thrd;

cell_t c;

#endif

#if !RP_HOST

thrd=Lookup_Thread(domain,2);

begin_c_loop(c, thrd)

i=i+2;

end_c_loop(c,thrd)

number=number/i;

Message("%g\n", i);

#endif

}

I could only got i=1 according to the output file.

Anybody could help me? Thanks a lot.

Jun
  Reply With Quote

Old   October 26, 2011, 12:49
Default
  #2
Member
 
Shawn Fotovati
Join Date: Jul 2009
Location: Cincinnati, OH
Posts: 40
Rep Power: 7
sfotovati is on a distinguished road
I have the same problem,
I wanna loop over the faces of a cell in a UDF with DPM_SCALAR_UPDATE macro, it works when I am running sequential, but as it becomes parallel, the values related to the cell faces become zero. I do not know how should I take care of the UDF in parallel form. any help?
sfotovati 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
DPM model in parallel batch mode Prashanth FLUENT 2 March 6, 2009 07:54
parallel mode - small problem? co2 FLUENT 2 June 1, 2004 23:47
to do a run in parallel mode with star_hpc massimo CD-adapco 4 January 30, 2003 08:33
How to run his phoenics in parallel mode? Bryan Lam Phoenics 3 December 19, 2001 09:43
TASCflow,problem with script and parallel mode Zbynek Hrncir CFX 0 October 2, 2001 07:30


All times are GMT -4. The time now is 00:06.