|
[Sponsors] |
July 24, 2008, 20:52 |
A UDF Problem in Parallel Mode
|
#1 |
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 |
|
October 26, 2011, 13:49 |
|
#2 |
Member
Shawn Fotovati
Join Date: Jul 2009
Location: Dallas, TX
Posts: 42
Rep Power: 17 |
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? |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DPM model in parallel batch mode | Prashanth | FLUENT | 2 | March 6, 2009 08:54 |
parallel mode - small problem? | co2 | FLUENT | 2 | June 2, 2004 00:47 |
to do a run in parallel mode with star_hpc | massimo | Siemens | 4 | January 30, 2003 09:33 |
How to run his phoenics in parallel mode? | Bryan Lam | Phoenics | 3 | December 19, 2001 10:43 |
TASCflow,problem with script and parallel mode | Zbynek Hrncir | CFX | 0 | October 2, 2001 08:30 |