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

Scheme commands for compute nodes

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By AlexanderZ
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2020, 11:42
Default Scheme commands for compute nodes
  #1
New Member
 
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6
manish1308 is on a distinguished road
Hey,
I am running a simulation using parallel computing and I am using scheme commands. The issue is that I am not able to run the simulation and I think the issue is the scheme commands are running on the host node rather than the compute nodes. Are there any commands which will run the scheme commands on the compute nodes.
For eg In UDF you can use #if !RP_HOST. Something like that for scheme?

Thank you ,
Manish
manish1308 is offline   Reply With Quote

Old   July 15, 2020, 22:53
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
scheme is executed on CORTEX, with is even above host node.
there is no way to execute scheme on computational nodes, as far as I know.

show yoour code, Ill try to give you advice.
sometimes there is a problem with scheme in parallel consideration
manish1308 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   July 16, 2020, 10:36
Default Scheme
  #3
New Member
 
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6
manish1308 is on a distinguished road
Hi Alexander,
Thank you for your reply. Here are the scheme commands I am using-
(do ((x 1 (+ x 1))) ((> x 2))
(rename-file (format #f "Input_~a.c" x) "Input.c" )
(ti-menu-load-string (format #f "/file/read-case "file-name.cas.gz""))
(ti-menu-load-string (format #f "/file/read-data "file-name.dat.gz""))
(ti-menu-load-string(format #f "solve initialize initialize-flow it 50"))
(ti-menu-load-string (format #f "wc file-name-Test-~a.cas.gz" x ))
(ti-menu-load-string (format #f "wd file-name_Test-~a.dat.gz" x ))
(rename-file "Input.c" (format #f "Input_~a.c" x )))

And the input.c file is read in a udf to extract values for the further calculations.
The .c file for the udf is using #if !RP_HOST to make sure it runs on the compute node.
manish1308 is offline   Reply With Quote

Old   July 17, 2020, 00:50
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you don't read .c file in the code above.

do you interpret it somewhere else? I recommend you to compile your code( .c file)
so you can load precompiled library from scheme
manish1308 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   July 23, 2020, 11:07
Default Scheme Commands
  #5
New Member
 
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6
manish1308 is on a distinguished road
Hello,
Thank you for the reply. Actually the Input_1.c and Input_2.c are just files in which different numbers are stored. It was .csv file I just renamed it to .c file because the .csv file is not getting copied on the compute nodes.
So I wont be able to compile that, I mean it does not have any commands like #include "udf.h" . It just has a row of numbers. This file is read in another .c file where it picks these values and assigns them in udf. That file is compiled.
manish1308 is offline   Reply With Quote

Old   July 24, 2020, 00:44
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you should organize reading from file in UDF suitable for parallel computation
are you sure it has been done?

once again, you don't read files in scheme, you just rename them
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   July 24, 2020, 10:36
Default Scheme Parallel
  #7
New Member
 
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6
manish1308 is on a distinguished road
Yes, I am reading from a udf which is suitable for parallel computation.

These are the parts of the code which read the file.


#include "udf.h"
#if RP_DOUBLE
# define MY_INPUTS "%lg, %lg, %lg\n"
#else
# define MY_INPUTS "%g, %g, %g\n"
#endif

real QdotZ1;
real QdotZ2;
real QdotZ3;
real A;
real B;
real C;

DEFINE_EXECUTE_ON_LOADING(test,lib2)
{
#if !RP_HOST
int i=0;
FILE* cFile;

cFile = fopen("Input.c","r");

for (i = 0; i<1; i++)
{
fscanf(cFile,MY_INPUTS,&A, &B,&C);
QdotZ1 = A;
QdotZ2 = B;
QdotZ3= C;

}
fclose(cFile);
#endif
}
manish1308 is offline   Reply With Quote

Old   July 26, 2020, 22:49
Default
  #8
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you are using #if !RP_HOST macro, which means, you are reading file on nodes

usually you want to read file on Host, not on nodes. But transfer data from host to nodes after reading is finished

to transfer data you need host_to_node_real macro

this could be the problem
for more information read Ansys FLuent Customization manual -> Chapter 7: Parallel consideration
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 30, 2020, 11:04
Default
  #9
Senior Member
 
AH
Join Date: Apr 2014
Posts: 282
Rep Power: 13
visitor is on a distinguished road
Hi,
I can see you are experts in TUI Scheme.

Can anyone show me an example in how to read temperature, and then loop for the next cell? Please.

Or read all the cells temperature values? I can then apply an 'if ' condition statement to take a specific action depending on cell value.

Thanks.
visitor is offline   Reply With Quote

Reply

Tags
fluent, parallel computing, scheme


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
Scheme File Needed For UDF to Work? m_ridzon Fluent UDF and Scheme Programming 5 December 31, 2018 08:34
Implementation of QUICK scheme Romuald Skoda Main CFD Forum 11 November 6, 2017 21:20
command TUI / Scheme for stop and continue calculate rayolau FLUENT 1 May 13, 2013 10:20
Problem do loop using Scheme commands kris FLUENT 0 January 13, 2008 06:15
FLUENT scheme language Luca FLUENT 2 October 21, 2004 04:51


All times are GMT -4. The time now is 10:57.