How to let UDF run in parallel
Hello I have the below UDF for mixture density it works fine in series I want to run it in parallel what changes I need to add.
include "udf.h" DEFINE_PROPERTY(c_densityN10RaT1E6, c, t) { real rhm,rho,To,Co,betaT,betaC; real T = C_T(c,t); rho= 1.12; Co=0.049; To=313.15; betaT=0.0032; betaC=0.590636677; rhm = rho*(1.-betaT*(T-To)-betaC*(1.*C_YI(c,t,0)-Co)); /* density of mixture */ return rhm; } Thanks Mariam |
Parallelization
Usually, such code do not require parallelization. However, you can do that just to be sure.
Put whole of the code within #if !RP_HOST #endif #if must be after opening brace of the DEFINE_ function and #endif before the the closing brace. |
Many thanks Vinerm to the reply. Is that used normally with interpret option or I need to use compile when using parallel?
Mariam Quote:
|
Parallelization
Compilation or Interpretation are not related to parallelization. So, if you are using the code for parallel simulation, you should parallelize it, doesn't matter whether you compile or interpret.
|
All times are GMT -4. The time now is 20:21. |