unclear SILENT error when using db.iter_elemId() method

44 views
Skip to first unread message

hans-o. istok

unread,
Oct 20, 2022, 6:29:37 AM10/20/22
to FeResPost
Hello Renaud,

i recently discovered the FeResPost module and try to use it.
Generally i have to admit that i am only an "advanced" beginner in python, so may be the issue is not really an issue i currently face.

I am using your model "../MODEL/MAINS/unit_xyz.bdf" in order to familiarize with your module.
i am using Spyder 4.x.y as IDE.
Basis is Python 3.8.8.

i have attached several pictures to show what is happening:
"codeOfCalledFunction.png"  -> the code of the function in a separate python file with indication of where the issue occurs
"callingFunction.png"  -> part of function FROM which the called function issuing the error is envoked
"kernel_restart.png"  -> NO error occurs AT ALL is shown in the console, just the kernel restarts
"outputOfCalledFunction.png" -> the output (stdout redirected to a file)

As you can see in the outputOfCalledFunction.png the method seems to correctly iterate through ALL the element IDs in the db. After each iteration i add the output "iamhereinTheLoop".
This ouput appears for all elements EXCEPT for the last element Id (HEXA eID: 91240). Then the loop ends incorrectly since the last print AFTER the loop is not done and without any message and the kernel restarted.

Do you have any suggestion what the problem might be?
Am i doing something wrong which is actually not related to FeResPost module itself?

Please forgive me if the "issue" turns out to be a beginners failure.....

Thanks a lot for your help in advance.
Cheers

hans

outputOfCalledFunction.png
codeOfCalledFunction.png
callingFunction.png
kernel_restart.png

Renaud Sizaire

unread,
Oct 20, 2022, 12:41:19 PM10/20/22
to fere...@googlegroups.com
Hello Hans,

Thank you for trying FeResPost. I will test the iterator with the version of Python 3.8.8 tomorrow.

Meanwhile, I advise you to try your script directly with Python (outside Spyder). And above all, flush standard output after each write statement. (I suspect that last printed lines are kept in a buffer and not visible. Therefore, you might not see the right source of problem.

For flushing standard output, please read, for example, the following post :

Regards,

Renaud

Le 20-10-22 à 12:29, hans-o. istok a écrit :
--
You received this message because you are subscribed to the Google Groups "FeResPost" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ferespost+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ferespost/ec4b32df-a5a7-4214-a006-92188ec8a6f0n%40googlegroups.com.


FeResPost

unread,
Oct 21, 2022, 1:34:54 AM10/21/22
to FeResPost
Hello Hans,

I just checked the iterator with version 3.8 of Python. It works on my computer.

I suspect the problem is related to the fact you work with Spyder IDE. I always launch python via a batch file that define path, python load path... I suggest you try that first.

If you want to work with your IDE, you should try the option "flush=True" in your print statements. You can also try to print debugging information to stderr instead of stdout. This might solve your problem as stderr does not "bufferize" the output.

Regards,

Renaud

hans-o. istok

unread,
Oct 21, 2022, 6:00:11 AM10/21/22
to FeResPost
Hello Renaud,

thanks a lot for your quick response and your proposal.
I will check asap and let you know if it works.

Encore une fois: merci bien!
hans

hans-o. istok

unread,
Oct 21, 2022, 10:40:45 AM10/21/22
to FeResPost
Hello Renaud,

thanks again for your help and your proposals.
Unfortunately i was not able to progress in the issue. 
i tested:
- running my code directly in the shell including the flush=True option. Result: identical, ie no further error infos, all silent
 i went in the shell to the respective run-folder and launched it with: "python ./run.py"
- i tried the same yet simplified in a jupyter notebook. Result: identical, ie restart of the kernel, otherwise silent
- i tested the same in vsCode IDE; Result:  identical, ie restart of the kernel, otherwise silent

as an additional info: 
i created a separate environment for my work: FeResPost is saved in the respective environment folder:
      C:\Users\*MyUserId*\.conda\envs\py388RUISH\Lib\site-packages\FERESPOST

So what i do now is send you my files, maybe you can spot very quickly the issue.....

Thank you anyway for your efforts in helping me!

Best regards
hans
TEST_FERESPOST.zip

FeResPost

unread,
Oct 21, 2022, 11:38:16 AM10/21/22
to FeResPost
Hello Hans,

I spent some time adapting your sources to my environment and managed to run the code. I find no problem on my computer. (See the attached outputs.) I do not use your Spider IDE however. Instead, I use Python directly launching it with the "run.bat" Batch file.

I believe your problems are related to the use of Spider and do not want to spend too much time debugging a tool I do not intend to use. So I suggest that you work directly with Python (as I do in FeResPost examples).

Regards,

Renaud

Note: I renamed "run.bat" to "run.txt" to allow its uploading on Google groups.
run.txt
run.py.log

FeResPost

unread,
May 1, 2023, 4:54:12 AM5/1/23
to FeResPost
Hello Hans,

Last week, I shared in "DOWNLOADS/LATEST_DEV/20230422 (5.0.5.b)" directory of FeResPost web site new binaries that have been compiled without the "-static" option of g++ compiler.

I produced these new binaries because I noticed that C++ exceptions were no longer handled by the "catch" statements. This might explain your SILENT errors. Using new binariesmight help you understand the source of the problem. (It could be a bug in your Python script as well as a bug in FeResPost.)

Regards,

Renaud

Hans-Otto Istok

unread,
May 2, 2023, 1:53:11 AM5/2/23
to fere...@googlegroups.com

Hi Renaud!!!

 

Thanks a lot for remembering my issue! Thanks a lot!

I will check asap and try to give you feedback!

 

Until then have a good time!

 

Regards,

hans

 

From: 'FeResPost' via FeResPost <fere...@googlegroups.com>
Sent: Montag, 1. Mai 2023 10:54
To: FeResPost <fere...@googlegroups.com>
Subject: [EXT] Re: unclear SILENT error when using db.iter_elemId() method

 

CAUTION: This email originated outside of our organization. Don't click on links or attachments unless you recognize the sender and know the content is safe. Report all suspicious e-mails using the Report Phishing button.


--

You received this message because you are subscribed to the Google Groups "FeResPost" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ferespost+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages