CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS

UDF in parallel (fscanf)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2012, 17:03
Default UDF in parallel (fscanf)
  #1
Member
 
Vitaly
Join Date: Jan 2012
Posts: 32
Rep Power: 14
Vitaly is on a distinguished road
Hello,

I have a UDF that's using an fscanf function to scan a file with point coordinates. Everything works great in Serial, but when simulating in parallel (even with only 1 processor), specifically the fscanf function is causing the following error output:

0 (..\src\mpsystem.c@1173): mpt_read: failed: errno = 10054

0: mpt_read: error: read failed trying to read 4 bytes: No such file or directory
MPI Application rank 0 exited before MPI_Finalize() with status -1
The Parallel FLUENT process could not be started.

The function is being executed by the host.

Has anyone seen this?

Thanks,

Vitaly
Vitaly is offline   Reply With Quote

Old   October 10, 2012, 05:21
Default
  #2
New Member
 
Join Date: Nov 2010
Posts: 22
Rep Power: 15
gi12 is on a distinguished road
Dear Vitaly,

If you solved your problem can you please let me know how, as I have similar error with fscanf

Many thanks,
GI
gi12 is offline   Reply With Quote

Old   October 10, 2012, 14:18
Default
  #3
Member
 
Vitaly
Join Date: Jan 2012
Posts: 32
Rep Power: 14
Vitaly is on a distinguished road
Hi GI,

To be honest, I don't remember exactly what I did. Looking at my code, I the format looks like this:

DEFINE_ON_DEMAND(func)
{
real input[N];

cfPtr = fopen("finle_name.txt", "r");
for (i = 0; i<N; i++)
{
fscanf(cfPtr,"&lf",&input[i];
}

}

To be honest, I have not looked at this code in a while and don't currently have Fluent installed to check it. In fact, I found it on an old printout that I had in my desk. Nevertheless, I think it worked for me.
I should say that I would get very frustrated with Fluent compiler. Even when I took a UDF class at ANSYS, the instructor was getting frustrated also because simple function would not work. Sometimes I would try the exact same UDF on a different computer in my lab (with Fluent) and it would work with no problem!

I know this is not an ideal explanation, but I hope it helps!

Good luck!

-Vitaly
Vitaly 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
Parallel UDF problem Lindsay FLUENT 4 June 20, 2016 09:37
"Define_Profile" UDF for parallel solver Antoine Fluent UDF and Scheme Programming 9 February 29, 2016 06:09
Help with Define on Demand UDF in Parallel Mahesh FLUENT 2 August 7, 2007 05:34
Parallel UDF Error Andrew FLUENT 2 March 30, 2007 11:11
UDF in parallel version. yobee FLUENT 0 August 17, 2004 04:12


All times are GMT -4. The time now is 23:21.