CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

does Hyperthreading affect the application of UDF?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By LuckyTran
  • 1 Post By blackmask
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2018, 11:56
Default does Hyperthreading affect the application of UDF?
  #1
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
Hi~

I wrote a udf using a DEFINE_PROFILE example in the manual.

This udf was applied in Fluent 19.1 on Windows 10.
The CPU is Intel Core i7-7700.

This udf could be compiled and built, but there were some warnings.
If I continue to load it, errors showed up.

I am wondering if the hyper-threading is the reason, because the warning said that it was Automatically switched to run in parallel -t1 mode, and I was running in Serial.

Had anyone handled this situation?
Could you tell me how to solve this?
Thank you!



One can find information about hyperthreading written in the file "Installation_and_Licensing_Documentation.pdf" or the InstalHelp.
It says:

If you are running on Intel's Xeon EM64T system, we recommend that you turn CPU hyperthreading
off (default is on). A system administrator needs to reboot the system and enter the BIOS to turn
the hyperthreading option off.


Hyperthreading technology uses one processor core to run more than one task at a time. ANSYS does
not recommend using hyperthreading technology in conjunction with ANSYS CFD Solvers (Fluent, CFX
and AIM Fluids).We recommend that you turn CPU hyperthreading off (default is on). A system administrator
needs to reboot the system and enter the BIOS to turn the hyperthreading option off.




Here are the error messages:

A. Run in Serial:
The messages appeared on the TUI window are as follows:

> Copied O:\test/O:\test\pressure_height.c to libudf\src

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************


and when I press the "load" button, the message:

Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\n系統找不到指定的檔案。
\n\nO:\test\libudf\win64\3ddp_host\libudf.dll
Error Object: #f





B.Run in Parallel by choosing 2 processes in Fluent Launcher,
the message:

Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

Error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

Error at Node 1: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).


and when I press the "load" button, the message:

Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\n系統找不到指定的檔案。
\n\nO:\test\libudf\win64\3ddp_host\libudf.dll
Error Object: #f
SJSW is offline   Reply With Quote

Old   October 9, 2018, 14:36
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Hyperthreading should always be off for CFD applications but that is not the cause of your problems. Hyperthreading is invisible to running programs and is handled at the job scheduler level, which you have no control over.

Fluent is deprecating its serial mode to ensure users always make their udf's parallel compatible (hence the parallel -t1 message). It's running parallel Fluent with one process. If all else fails and you need to use the true serial Fluent, you need to pass the -t0 flag.

Your errors are the same in both cases. Your UDF is not compiled for parallel usage. Sorry I can't help you with how to write your udf or help you debug what is wrong with it. But your problem & solution is just to figure out how to make your udf parallel-ready.

The Fluent manual needs to be updated. I followed the steps for a pressure profile and I got a parse error when I tried to load the udf. Unfortunately I didn't devote any time to figuring out what steps have changed since I haven't recently used any udf's. Probably I am missing some very basic understanding that someone else can easily point out.
SJSW likes this.
LuckyTran is offline   Reply With Quote

Old   October 9, 2018, 21:33
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
Did you compile UDF library before using it?

best regards
AlexanderZ is offline   Reply With Quote

Old   October 9, 2018, 21:54
Default
  #4
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
I add the udf file by following steps:
User Defined-> Functions -> Compiled-> open "Compiled UDFs" window -> add file-> Build -> Load

Did some steps missed?
Could you tell me?
Thank you!
SJSW is offline   Reply With Quote

Old   October 10, 2018, 01:51
Default
  #5
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
You should turn off hyper-threading but the error is not related to hyper-threading. You simply have failed to compile the "libudf" library. Did you install visual studio and launch fluent from the visual studio command prompt?
SJSW likes this.
blackmask is offline   Reply With Quote

Old   October 10, 2018, 07:21
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by SJSW View Post
I add the udf file by following steps:
User Defined-> Functions -> Compiled-> open "Compiled UDFs" window -> add file-> Build -> Load

Did some steps missed?
Could you tell me?
Thank you!
Show what comes on your screen after you click 'Build'.
pakk is offline   Reply With Quote

Old   October 10, 2018, 08:03
Default
  #7
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road

I installed Visual Studio 2012.
Is it not new enough? @@
Please tell me.
Thank you!


After I clicked "Build", it showed:

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "libudf7\win64\3ddp_host\makefile" ")
複製了 1 *蚗仵蛂C
(chdir "libudf7")(chdir "win64\3ddp_host")'nmake' 不是內部或外部命令、可執行的程式或批次檔。

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "libudf7\win64\3ddp_node\makefile" ")
複製了 1 *蚗仵蛂C
(chdir "libudf7")(chdir "win64\3ddp_node")'nmake' 不是內部或外部命令、可執行的程式或批次檔。

Done.


I don't know what these strange codes,
"複製了 1 *蚗仵蛂C" and "不是內部或外部命令、可執行的程式或批次檔。 ",
means.

Are there strange codes normal?
SJSW is offline   Reply With Quote

Old   October 10, 2018, 09:58
Default
  #8
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
I installed Visual Studio 2017 Professional.

I checked the content of this file "C:\Program Files\ANSYS Inc\v191\fluent\ntbin\win64\udf.bat".
I don't know that if is there anything missing?
Could you tell me?
Thank you!

The content s written as follows :

@echo off
rem ---
rem MS Visual C++
rem ---
set MSVC=
set MSVC_VERSION=0

echo trying to find MS C compiler, version 150....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio\2017
if exist "%MSVC_DEFAULT%\Community\VC\Auxiliary\Build\vcvar sall.bat" set MSVC=%MSVC_DEFAULT%\Community
if exist "%MSVC_DEFAULT%\Professional\VC\Auxiliary\Build\vc varsall.bat" set MSVC=%MSVC_DEFAULT%\Professional
if exist "%MSVC_DEFAULT%\Enterprise\VC\Auxiliary\Build\vcva rsall.bat" set MSVC=%MSVC_DEFAULT%\Enterprise
if not "%MSVC%" == "" goto msvc_env150

echo trying to find MS C compiler, version 140....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0
if exist "%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env140

echo trying to find MS C compiler, version 120....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 12.0
if exist "%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env120

echo trying to find MS C compiler, version 110....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0
if exist "%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env110


echo trying to find MS C compiler, version 100....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0
if exist "%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env100


echo trying to find MS C compiler, version 90....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0
if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env90

set MSVC_DEFAULT=%ProgramFiles%\Microsoft Visual Studio 9.0
if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env90


echo trying to find MS C compiler, version 80....

set MSVC_DEFAULT=%ProgramFiles%\microsoft visual studio 8
if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env80

set MSVC_DEFAULT=%ProgramFiles(x86)%\microsoft visual studio 8
if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env80


echo trying to find MS C compiler, version 71....

set MSVC_DEFAULT=%ProgramFiles%\microsoft visual studio .net 2003
if exist "%MSVC_DEFAULT%\vc7\bin\cl.exe" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env71


echo trying to find MS C compiler, version 70....

set MSVC_DEFAULT=%ProgramFiles%\microsoft visual studio .net
if exist "%MSVC_DEFAULT%\vc7\bin\cl.exe" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env70


echo trying to find MS C compiler, version 60....

set MSVC_DEFAULT=%ProgramFiles%\microsoft visual studio
if exist "%MSVC_DEFAULT%\vc98\bin\cl.exe" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env60


echo trying to find MS C compiler, SDKs....

set MSVC_DEFAULT=%PROGRAMFILES%\Microsoft.NET\SDK\v2.0 64bit
if exist "%MSVC_DEFAULT%\Bin\sdkvars.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_sdk2.0

set MSVC_DEFAULT=%PROGRAMFILES%\Microsoft SDKs\Windows\v6.1
if exist "%MSVC_DEFAULT%\Bin\SetEnv.Cmd" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_sdk61


echo "No MSVC compiler detected!"
goto fail_end

:ms_c_v_warning
echo Warning: Unable to find MS C Compiler version %MS_C_V%
goto ms_c_end

:msvc_env80
set MSVC_VERSION=80
call "%MSVC%\VC\vcvarsall.bat" amd64
goto ms_c_end

:msvc_env90
set MSVC_VERSION=90
call "%MSVC%\VC\vcvarsall.bat" amd64
goto ms_c_end

:msvc_env100
set MSVC_VERSION=100
call "%MSVC%\VC\vcvarsall.bat" amd64
goto ms_c_end

:msvc_env110
set MSVC_VERSION=110
call "%MSVC%\VC\vcvarsall.bat" x86_amd64
goto ms_c_end

:msvc_env120
set MSVC_VERSION=120
call "%MSVC%\VC\vcvarsall.bat" x86_amd64
goto ms_c_end

:msvc_env140
set MSVC_VERSION=140
call "%MSVC%\VC\vcvarsall.bat" x86_amd64
goto ms_c_end

:msvc_env150
set MSVC_VERSION=150
call "%MSVC%\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
goto ms_c_end

:msvc_env71
set MSVC_VERSION=71
call "%VS71COMNTOOLS%\vsvars32.bat"
goto ms_c_end

:msvc_env60
set MSVC_VERSION=60
set path=%MSVC%\vc98\bin;%MSVC%\common\msdev98\bin;%pa th%
set include=%MSVC%\vc98\include;%MSVC%\vc98\mfc\includ e;%include%
set lib=%MSVC%\vc98\lib;%MSVC%\vc98\mfc\lib;%lib%
goto ms_c_end

:msvc_sdk2.0
set MSVC_VERSION=SDK 2.0
call "%MSVC_DEFAULT%\Bin\sdkvars.bat"
goto ms_c_end

:msvc_sdk61
set MSVC_VERSION=SDK 6.1
call C:\Windows\System32\cmd.exe /E:ON /V:ON /T:0E /K "%MSVC_DEFAULT%\Bin\SetEnv.Cmd" /x64
goto ms_c_end

:ms_c_end
if "%MSVC%" == "" goto fail_end

echo Detected MSVC%MSVC_VERSION% under "%MSVC%"
echo path=%path%
echo include=%include%
echo lib=%lib%

:fail_end
SJSW is offline   Reply With Quote

Old   October 10, 2018, 10:35
Default
  #9
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
I think that I found a solution.
it is different with my experience using earlier version of Fluent such as ANSYS14 and 17.

I check the Environment tab in Fluent Launcher and found that the path of "Set up Compilation Environment for UDF" is empty.
It should be assigned after Visual Studio was installed.

I have not closed hyperthreading in BIOS. maybe later.

So now I have to input this path in the Environment tab when I create a new case file.

Are some steps missing? @@
SJSW is offline   Reply With Quote

Old   October 10, 2018, 11:13
Default
  #10
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by SJSW View Post

I installed Visual Studio 2012.
Is it not new enough? @@
Please tell me.
Thank you!


After I clicked "Build", it showed:

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "libudf7\win64\3ddp_host\makefile" ")
複製了 1 *蚗仵蛂C
(chdir "libudf7")(chdir "win64\3ddp_host")'nmake' 不是內部或外部命令、可執行的程式或批次檔。

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v191\fluent"\fluent19.1.0\sr c\udf\makefile_nt.udf "libudf7\win64\3ddp_node\makefile" ")
複製了 1 *蚗仵蛂C
(chdir "libudf7")(chdir "win64\3ddp_node")'nmake' 不是內部或外部命令、可執行的程式或批次檔。

Done.


I don't know what these strange codes,
"複製了 1 *蚗仵蛂C" and "不是內部或外部命令、可執行的程式或批次檔。 ",
means.

Are there strange codes normal?

Those strange codes are not normal, but I can decipher them.
Fluent is asking your operating system to start the program "nmake" to compile your code, but can not find that program. So your operating system responds that it can not find that program, but because you set your language to (I guess) traditional Chinese, the operating system says this in traditional Chinese characters, in Unicode. The Fluent text interface box does not know Unicode, and interprets these multi-byte characters as simple characters, and shows the strange codes that you see.



So, these codes mean that Fluent does not know where the compiler is.
pakk is offline   Reply With Quote

Old   October 10, 2018, 12:06
Default
  #11
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
Woa...thank you~

and how can I change the language to English so that I can see the info contained in these strange code?
Could you tell me?
Thank you!
SJSW is offline   Reply With Quote

Old   October 10, 2018, 22:28
Default
  #12
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
take a look into following link Compile Fluent UDF with Windows 10

you may find the solution for compiling problem there

best regards
SJSW likes this.
AlexanderZ is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for vapor pressure anuarun Fluent UDF and Scheme Programming 12 December 24, 2021 10:12
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 12:43
Replicating Scalable Wall Function with a UDF yousefaz FLUENT 0 August 4, 2017 02:30
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
Help me to check my UDF Liufeng_ustb Fluent UDF and Scheme Programming 2 May 7, 2013 10:25


All times are GMT -4. The time now is 01:20.