|
[Sponsors] |
June 20, 2006, 10:35 |
Help Parallelizing UDF - THREAD_STORE
|
#1 |
Guest
Posts: n/a
|
I am trying to get this UDF to compile (correctly) after parallelizing and I'm not having much luck. Any help is appreciated.
I am using the DEFINE_PROFILE function to set a wall BC (velocity inlet). Everything works perfectly fine in serial mode, but it does not work correctly in parallel mode. In serial mode, if I set the BC to some value using the F_PROFILE function and use a velocity sensor (C_U,V,W) to record the velocity in a cell close to the wall, the results seem to correlate well, but if I do the exact same thing in parallel mode, the velocity sensor reads ~0m/s. One thing I thought was odd was that the HOST process is not being called in the DEFINE_PROFILE function at all. I am using 2 NODES (to debug for now), and those are the only processes which run through this function. That aside, the real issue is getting F_PROFILE to work right in parallel. I've tried using if(PRINCIPAL_FACE_P), but upon adding this I get a compiler error - THREAD_STORE: undeclared variable. I'm not sure how to interpret this.....Even if I try to isolate one of the NODES to update the BC using F_PROFILE, the velocity sensor still reads ~0m/s. Anyone have suggestions? Code is shown below (I realize it is a bit hokey, because NODE 0 is writing the datafile, but this is all I could do since the HOST does not seem to run this function.....): DEFINE_PROFILE(dist_source, t, i) { #if !RP_HOST face_t f; #endif real source; real velmag = 0; real time = CURRENT_TIME; FILE* fp1; int m; real pi = 3.1415926; fp1 = fopen("dist.txt","a+"); velmag = 1.5*sin(2.5*2.0*pi*time); source = velmag; host_to_node_real_1(source); #if RP_NODE if(I_AM_NODE_ZERO_P) #endif { if(ash2!=time) { fprintf(fp1,"%f\n",source); ash2 = time; } fclose(fp1); } #if !RP_HOST //update disturbance jet face begin_f_loop(f,t) if(PRINCIPAL_FACE_P(f,t)) //Adding this line gives me an error upon compilation for parallel mode { F_PROFILE(f,t,i) = source; } end_f_loop(f,t) #endif } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
automatic parallelizing udf | chaos | FLUENT | 2 | August 1, 2011 01:51 |
multi-core processor about parallelizing udf | dasah | Fluent UDF and Scheme Programming | 0 | June 23, 2011 10:50 |
Help Parallelizing UDF | AndresC | FLUENT | 0 | February 25, 2010 15:50 |
Help, parallelizing UDF problem. | blivurmind | Fluent UDF and Scheme Programming | 2 | July 24, 2009 11:40 |
Help, parallelizing UDF problem | blivurmind | FLUENT | 0 | July 9, 2009 21:39 |