CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   ANSYS (http://www.cfd-online.com/Forums/ansys/)
-   -   UDF in parallel (fscanf) (http://www.cfd-online.com/Forums/ansys/102773-udf-parallel-fscanf.html)

Vitaly June 1, 2012 17:03

UDF in parallel (fscanf)
 
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

gi12 October 10, 2012 05:21

Dear Vitaly,

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

Many thanks,
GI

Vitaly October 10, 2012 14:18

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


All times are GMT -4. The time now is 19:27.