|
[Sponsors] |
August 25, 2021, 08:13 |
UDF_Parallel_Programming
|
#1 |
New Member
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 7 |
Hello everyone,
i did the udf programming before but that was for serial mode. and i'm new to this parallel programming and bit confused about what to solve on host and what on node. i've written a program for unsteady temperature profile is it correct or what changes should i make further ? please guide. /************************************************** ************************************************** ************************************************** ***/ #include "udf.h" DEFINE_PROFILE(unsteady_temp, thread, position) { #if !RP_HOST /* Compile this section for computing processes only (serial and node) since these variables are not available on the host */ real x[ND_ND]; face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); F_PROFILE(f, thread, position) = 6.61e-21*t*t*t*t*t-8.33e-18*t*t*t*t+1.5e-14*t*t*t+3.071e-08*t*t-7.518e-04*t+307.05; } end_f_loop(f, thread) #endif /* !RP_HOST */ } if i use this same program as above will it work fine for parallel solver? thanks in advance. |
|
August 26, 2021, 00:54 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
this code doesn't require additional directives like #if !RP_HOST to work in parallel,
you may remove it and run your UDF in serial/parallel
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 26, 2021, 01:03 |
|
#3 | |
New Member
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 7 |
Quote:
i tried to compile udf by removing directives but it is throwing this error. # Generating udf_names.c because of makefile unsteady_temp.C udf_names.c # Linking libudf.dll because of makefile user_nt.udf udf_names.obj unsteady_temp.C Microsoft (R) Incremental Linker Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved. LINK : fatal error LNK1181: cannot open input file 'unsteady_temp.C' Creating user_nt.udf file for 2ddp_node ... (system "copy "C:\PROGRA~1\ANSYSI~1\v190\fluent"\fluent19.0.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp_node\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\2ddp_node")# Generating ud_io1.h unsteady_temp.C |
||
August 26, 2021, 06:55 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
And with serial you did not get this error?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
August 26, 2021, 06:59 |
|
#5 |
New Member
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 7 |
||
August 26, 2021, 07:01 |
|
#6 | |
New Member
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 7 |
Quote:
/************************************************** ************************************************** *********/ this error is resolved just by renaming UDF from "unsteady_temp.C" to "unsteady_temp.c". |
||
Tags |
parallel computing, parallelize udf, temperature profile, udf code |
|
|