Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Error in "runcode.py"

Error in "runcode.py" 13 years 3 months ago #2002

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Hello,

I've been playing with a new version of TELEMAC and I ran into a problem with a Python script named "runcode.py" in scalar mode. After succesfully completing computation and copying the solution file from the temporary directory to the solution directory the following message is printed:

Traceback (most recent call last):
File "C:\TELEMAC\V6P0\bin\runcode.py", line 632, in <module>
runCAS(cfgname,cfg,codeName,casFile,options)
File "C:\TELEMAC\V6P0\bin\runcode.py", line 511, in runCAS
if not processECR(cas,oFS,CASDir,TMPDir,sortiefile,ncsize): sys.exit()
File "C:\TELEMAC\V6P0\bin\runcode.py", line 156, in processECR
if sortiefile.rstrip() != '':
AttributeError: 'NoneType' object has no attribute 'rstrip'


Last line suggests that the command in line 156 is not correct. The correct command for line 156 is:

if sortiefile is not None

(Another way to correct this error is to change the line 404 to sortiefile = '').

After this modification, aforementioned error did not appear in scalar version. My modified version of file runcode.py is provided in the attachment.

Best regards,
Budo

File Attachment:

File Name: runcode_Budo_Zindovic.rar
File Size: 6810
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2003

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Hello,

I made a novice mistake in the "runcode.py" (I forgot the colon in the line I've altered). Version provided in this e-mail is working properly.

Best regards,
Budo Zindovic

File Attachment:

File Name: runcode_Budo_Zindovic-20110803.rar
File Size: 6811
The administrator has disabled public write access.
The following user(s) said Thank You: sebourban

Re:Error in "runcode.py" 13 years 3 months ago #2044

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
I am very impressed !

Not only we did not yet provide any note on how to install or use the Python version of the scripts, but you even found a first bug.

Bravo !

On the wek-end, we will update the tags/v6p1 our SVN Repository, so you can update it rather simply ... which I am sure has no mistery for you anymore ...

Thank again for this valuable input.

Sébastien.
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2047

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Thank you very much for your kind words, Sébastien.

I was very curious to try the new Python scripts and I encountered this error. I thought that other developers would appreciate this bug fix.

While building new TELEMAC system, I realized that there is no script for cleaning the system from object files. I've tried to configure the system to clean (did that with the help of cfg file and setting module section to clean) but I'm not sure whether this is the proper way. I think that making a separate Python script which cleans the system would be very helpful for other developers.

I also realized that every TELEMAC module has its own set of compiled utility libraries (such as BIEF) but their size varies from module to module. What was the reason to change the way the whole system is built?

Best regards,
Budo
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2052

  • jmhervouet
  • jmhervouet's Avatar
Hello Budo,

In the old perl way you can erase the object files with the command "maktel menage" but this must be done in every directory of sources.

The Python scripts do not use the makefiles which are tedious to maintain, this is the advantage, but at the cost of a sophisticated procedure to find out in which order all the sources must be compiled.

Sébastien will have many more reasons to tell you..

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2053

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Indeed, you did right. having "clean system" in your module tag of the confi.cfg file is the solution.

Note that I would rather not have 2 python scripts. More difficult to maintain. The solution is to copy your configuration, say wing95s, and call it cleanw95s, and put your "clean system" command there.

Then you can use the -c cleanw95s option in your compileTELEMAC.py run.

In fact you can make your own names of the various configurtaion you want, including compiling only telemac2d, artemis, etc.

Much more flexible this way we though.

Hope this help.

Sébastien.
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2061

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Dear Jean-Michel and Sébastien ,

Thank you for you in-depth answers.

Best regards,
Budo
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2077

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Dear Sébastien,

I suppose you are referring to a new section in a configuration file. I changed the keyword in my current configuration (wintelmpi) to clean but all object files are not removed. I've created the new config as you suggested but that also didn't remove the object files. Maybe the Python scripts look into the source folders of every TELEMAC module (place to store object files in previous versions of TELEMAC) but now they are located in the folder named after my configuration. Or maybe I made a mistake that I'm not aware of?

Best regards,
Budo
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2088

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Indeed, the object files are now stored in the dirctory with the configuration name (this because different configuration, such as debug, etc.) would create different object files, which we now separate from one another.

The object files you may have in the sources directory would come from an install using the perl version. These are not used by the python version. If you delete them manually, they should not be re-created by the python version.

The clean system should work. Tell us otherwise.

Hope this helps.
The administrator has disabled public write access.

Re:Error in "runcode.py" 13 years 3 months ago #2095

  • bzindovic
  • bzindovic's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 68
  • Thank you received: 3
Dear Sébastien,

Maybe I've confused you with my last message. I wanted to say that the cause of this problem is that maybe the Python scripts are searching for object files in wrong folders (didn't wanted to mix Python and Perl compilation processes).

I've just ran the compileTELEMAC.py with the clean system switch and it didn't clean the object files or maybe it did I cannot tell because the compilation process was also initiated with the clean system. I have also tried to use only clean but it didn't help either. Can you verify that this is the same on your computer?

Regards,
Budo
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.