Welcome, Guest
Username: Password: Remember me

TOPIC: TelApy errors and uncertainties

TelApy errors and uncertainties 5 years 1 month ago #34655

  • Htun Pyae Sone
  • Htun Pyae Sone's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 2
Dear all,

I am trying to calibrate models using parameter optimization tools applying TelApy and another python package called "SPOTPY". So far, TelApy has been very helpful and useful thanks to the developers. However, I have some uncertainties and errors that I would like to ask.

1. In TelApy documentation, it is mentioned that "MODEL.CHESTR" variable as "Strikler on point". Thus, I assumed it is working only with the Strikler Friction law but when I tested with other laws, it works as well. So is "MODEL.CHESTR" for Friction coefficient for every friction law?


2. When I use TPXO for initial conditions as binary database for tide. It is showing me the following error. In the documentation, it is mentioned that modification should be done before memory allocation but I dun know how. Is there any example or documents as I might use other database such as netcdf. The error is as follow:
INITIALISATION BASED ON TPXO:
At line 2543 of file /home/sone/telemac-mascaret/v8p0r2/sources/telemac2d/tpxo.f
Fortran runtime error: Index '251658240' of dimension 1 of array 'c_id_mod' outside of expected range (29:1)


3. I have tested out genop and in there I believe "nproc" is used to parallel the genetic algorithm. So it is running each evolution in each core which mean one telemac simulation is carried out in each core. Am I correct? I am using SCEUA algorithm and it is carried out in similar process. But the limitation is for SCEUA the number of cores can be utilized on the number of complexes which I believe will be depend on population in GA. So my question is : is that possible to simulate the model in parallel and run the optimization algorithm in sequential. I am thinking about making a script for simulating the model and run it by subprocess. But is there any better idea coz I am not very fluent in python. Thank you.

4. When using TelApy with python3. I am getting this following error:
Traceback (most recent call last):
File "test.py", line 7, in <module>
project = Telemac2d('t2d_breach.cas',lang=2,comm=MPI.COMM_WORLD)
File "/home/sone/telemac-mascaret/latest/scripts/python3/telapy/api/t2d.py", line 58, in __init__
comm, recompile)
File "/home/sone/telemac-mascaret/latest/scripts/python3/telapy/api/api_module.py", line 167, in __init__
getattr(self.api_inter, "get_integer_array_" + self.name)
AttributeError: 'fortran' object has no attribute 'get_integer_array_t2d'
My compilation was successful.

Thank you so much for your time. Looking forward to your reply and suggestion.

Best Regards,
Htun
The administrator has disabled public write access.

TelApy errors and uncertainties 5 years 1 month ago #34659

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

1. Yes indeed I should correct the description

2. You can find see information in the documentation on tpxo.

3. Yes you can but you will have to be the one doing it in your Python script basically the parallelism of Telemac is handled via the MPI communicator you give him at the instanciation of the telemac2d class. I would need to see your script to help you further.

4. Which version are you using ? If you are on v8p0 then that bug is resolved in the trunk.

Hope it helps
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
The following user(s) said Thank You: Htun Pyae Sone

TelApy errors and uncertainties 5 years 1 month ago #34664

  • Htun Pyae Sone
  • Htun Pyae Sone's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 2
Dear Yugi,

Thank you so much for your reply and help. I will try to upload my script. As for python 3 I am using v8p0r2 and I will try to look it in the trunk. Thank you so much again.

Best Regards,
Htun
The administrator has disabled public write access.

TelApy errors and uncertainties 5 years 1 month ago #34667

  • Htun Pyae Sone
  • Htun Pyae Sone's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 2
Dear Yugi,

Thank you so much for your help again. The scripts I am currently using with spotpy module are the first two files.Although, spotpy itself is available in parallel as my mention its limitation is depending on number of complexes I choose. So I am thinking about doing the third script which is the simulation of TelApy by using "mpirun" command in subprocess taking input and output. However, I tried it and it is doing the pertel part and giving me the following error
ITERATION        0    TIME:   0.0000 S
 PRERES: MAXIMUM COURANT NUMBER:    0.5398760    
 TELEMAC2D INITIALIZED
 THE LIQUID BOUNDARIES FILE CONTAINS
           3  LINES WITH:
 SL(1)    Q(2)     
 USING STREAMLINE VERSION 7.3 FOR CHARACTERISTICS
At line 73 of file /home/sone/telemac-mascaret/v8p0r2/sources/api/api_handle_var_t2d.f
Fortran runtime error: Index '0' of dimension 1 of array 'inst%h%r' below lower bound of 1
At line 73 of file /home/sone/telemac-mascaret/v8p0r2/sources/api/api_handle_var_t2d.f
Fortran runtime error: Index '0' of dimension 1 of array 'inst%h%r' below lower bound of 1
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[8247,1],2]
  Exit code:    2

Or is there any other easier way without the subprocess to by execute just the Telapy in parallel while coupling with spotpy or genop.

Thank you so much for your time and help.

Best Regards,
Htun

File Attachment:

File Name: Estimation.py
File Size: 3 KB


File Attachment:

File Name: Optimize.py
File Size: 0 KB


File Attachment:

File Name: telemac_test.py
File Size: 1 KB
The administrator has disabled public write access.

TelApy errors and uncertainties 5 years 1 month ago #34674

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
Hi,

For your telemac_test.py the error comes from the missing global_num=True.

Hope it helps
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.
The following user(s) said Thank You: Htun Pyae Sone

TelApy errors and uncertainties 5 years 1 month ago #34705

  • Htun Pyae Sone
  • Htun Pyae Sone's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 2
Dear Yugi,

I tried as you mentioned. It is giving the same error. I attached both the script and error. The fact is it is working when I run in sequential. Thus I think it might not be the error. However, I have some questions as I am not very familiar with MPI.

1. In normal runcode.py or telemac.py the key words to parallelization is either adding PARALLEL PROCESSORS = 4 or --ncsize = 4. In Telapy, I am putting comm=MPI.COMM_WORLD and running the script by 'mpirun -c 4 python Telemac_test.py'. Is that a correct way or is there any other keyword as I could not find in documentation.

2. For TPXO, it is working with the normal runcode.py or telemac2d.py. It is giving me error when I using with Telapy. Would you please kindly specifies which documentation you mean if it is possible.

Thank you so much for your help and time.

Best regards,
Htun

File Attachment:

File Name: telemac_test_2019-10-14.py
File Size: 1 KB


File Attachment:

File Name: log.txt
File Size: 16 KB
The administrator has disabled public write access.

TelApy errors and uncertainties 5 years 1 month ago #34738

  • Htun Pyae Sone
  • Htun Pyae Sone's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 38
  • Thank you received: 2
Dear Yugi,

It is working. It is my mistake that I was thinking global_num should be True. Thank you so much for your help.

Best Regards,
Htun
The administrator has disabled public write access.
Moderators: pham

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