Welcome, Guest
Username: Password: Remember me

TOPIC: Modified fortran code computationall y slow

Modified fortran code computationall y slow 6 years 4 months ago #30780

  • Uma
  • Uma's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
Dear all,

I am trying to implement my code in TOMAWAC wave model.
I am struggling with this problem for more than 2 months.
Other codes for nonlinear energy transfers like DIA,
GQM (Gagnaire and Benoit 2010) and MDIA takes
very less time.

I ran the DIA(MDIA)​algorithm for time evolution
​(integration)​upto 96 hrs with 2 seconds time step.
I wonder, the TOMAWC model runs very fast,
within few seconds I could get the result.

Are they using any vectorisation or something else.
Generally what wave models are using. Please clear me.
Your valuable suggestions will help me a lot.

Thank you!
Uma. G
The administrator has disabled public write access.

Modified fortran code computationall y slow 6 years 4 months ago #30783

  • tfouquet
  • tfouquet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 294
  • Thank you received: 112
Hello Uma

So far there are no vectorisation in tomawac. Some optimisation have been made for DIA MDIA and GQM as non linear coefficient are calculated at the beginning ( calling prenl1 prenl2 and prenl3) and used at each time step.
GQM can be costly if you use the finest configuration (see the threshold keywords)

Hope it helps

Thierry.
The administrator has disabled public write access.
The following user(s) said Thank You: Uma

Modified fortran code computationall y slow 6 years 4 months ago #30785

  • Uma
  • Uma's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
Dear Dr. Thierry,

Thank you for your reply.

I agree that DIA, MDIA and GQM methods precompute the integrand (nonlinear co-efficients independent of spectrum, say F in the TOMAWAC model)using prenl1.f prenl2.f and prenl3.f respectively and the results are saved in a Table. During time evolution the above mentioned .f files are called via qnlin1.f, qnlin2.f and qnlin3.f depending upon the methods.

Currently, I replaced the existing code say, qnlin1.f (DIA) with mine and re-compiled the model. Is this correct approach or what else do I need do. I precomputed the integrand (nonlinear co-efficients) and instead of creating sub-routines, I saved it as .txt files(more than 20 files) and at each time step these .txt files are opened and closed.

Now my questions are:
1. Does this increase my computation time.
2. DO I need to make any change in the python script.
3. Or how the .f files are associated with .py files.
3. Does modification in DECLARATIONS_TOMAWAC, TOMAWAC.dico, LECDON_TOMAWAC, INTERFACE_TOMAWAC, NOMVAR_TOMAWAC, SEMIMP and WAC file are necessary.

Any help in this regard is highly appreciated. Awaiting for your reply.

Thanks in advance,
G. Uma
The administrator has disabled public write access.

Modified fortran code computationall y slow 6 years 4 months ago #30786

  • tfouquet
  • tfouquet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 294
  • Thank you received: 112
Dear Dr Uma

opening and closing a text file at each time step might not be the best, it can be costly, I would suggest you to store them in an array.
For example you can add an array in declaration_tomawac and use it in your version of prenl1 and your version of qnlin1.

Be careful if your version do not have the same number of argument you have to change it in the call of qnlin1 (in semimp) and in interface_tomawac too.

If you create a new subroutine you will have to launch
compileTELEMAC.py --rescan
(so that he will see that there is a new subroutine)

But that is all the modifications i see.

You're welcome

Thierry
The administrator has disabled public write access.

Modified fortran code computationall y slow 6 years 4 months ago #30790

  • Uma
  • Uma's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
Dear Dr. Thierry,

Thank you for your reply.
I will check the two possibilities and let you know the result.

Additionally, in my method for nonlinear energy transfers, the per-computation (like prelin1.f) involves matrices of very large size more than 30 lakh elements.

Does this storage increases computational cost.

Thank you for your time!
Uma. G
The administrator has disabled public write access.

Modified fortran code computationall y slow 6 years 4 months ago #30791

  • tfouquet
  • tfouquet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 294
  • Thank you received: 112
Hello Dr Uma

I don't know the unit lakh, but if there is enough place in your memory it won't increase computationnal case, if it is too big then your computer will store it itself on your disk.

Have a nice day

T.
The administrator has disabled public write access.
The following user(s) said Thank You: Uma

Modified fortran code computationall y slow 6 years 4 months ago #30798

  • Uma
  • Uma's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
Dear Dr. Thierry,

Thank you for your message.

As said earlier I ran my version of code for nonlinear energy transfers by replacing the existing qnlin1.f(DIA) as well with the existing one, MDIA (qnlin2.f), by giving 2 (for NONLINEAR ENERGY TRANSFERS) in semimp.f.

I attach the screen shots of Dos prompt
1. MDIA
2. My version

It can be noticed that in my case after copying the given files it is running the simulation, its skipping the middle one.

May be because of this my computation is expensive. If you could clear it will be of great help to me.

Thank you for your patience,
G. Uma
Attachments:
The administrator has disabled public write access.

Modified fortran code computationall y slow 6 years 4 months ago #30799

  • tfouquet
  • tfouquet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 294
  • Thank you received: 112
I am not sure to understand. I guess that what you call the middle one is the compilation, and i would say that it doesn't compile because it noticed that your exec file was more recent than your fortran file.
If your are annoy with that, delete your exec file (out_semimp.exe) before launching your simulation
The administrator has disabled public write access.
The following user(s) said Thank You: Uma

Modified fortran code computationally slow 6 years 4 months ago #30826

  • Uma
  • Uma's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
Dear Dr. Thierry,

Yes you are right and also thank you for your reply.

I would like to share two .CAS files along with .f files with you.
Since these files are more about my publication, i cannot share it in the forum.

If possible could you please give me your mail id so that I can send them to your mail with a detailed explanation.

Your valuable suggestions will help me a lot.

Thanks in advance,
Uma. G.
The administrator has disabled public write access.
Moderators: tfouquet

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