|
[Sponsors] |
July 15, 2020, 12:42 |
Scheme commands for compute nodes
|
#1 |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
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 |
|
July 15, 2020, 23:53 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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
__________________
best regards ****************************** press LIKE if this message was helpful |
|
July 16, 2020, 11:36 |
Scheme
|
#3 |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
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. |
|
July 17, 2020, 01:50 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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
__________________
best regards ****************************** press LIKE if this message was helpful |
|
July 23, 2020, 12:07 |
Scheme Commands
|
#5 |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
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. |
|
July 24, 2020, 01:44 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
July 24, 2020, 11:36 |
Scheme Parallel
|
#7 |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
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 } |
|
July 26, 2020, 23:49 |
|
#8 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
August 30, 2020, 12:04 |
|
#9 |
Senior Member
AH
Join Date: Apr 2014
Posts: 287
Rep Power: 0 |
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. |
|
Tags |
fluent, parallel computing, scheme |
|
|
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 09:34 |
Implementation of QUICK scheme | Romuald Skoda | Main CFD Forum | 11 | November 6, 2017 22:20 |
command TUI / Scheme for stop and continue calculate | rayolau | FLUENT | 1 | May 13, 2013 11:20 |
Problem do loop using Scheme commands | kris | FLUENT | 0 | January 13, 2008 07:15 |
FLUENT scheme language | Luca | FLUENT | 2 | October 21, 2004 05:51 |