Welcome, Guest
Username: Password: Remember me

TOPIC: Merging result files

Merging result files 6 years 2 months ago #31443

  • Mustermann
  • Mustermann's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 268
  • Thank you received: 4
Hi Nicolas,

Are you mean to merge a Telemac and a Tomwac .res file? If so I never heard of it, but I guess it should be possible somehow.

Regards,
Clemens
The administrator has disabled public write access.

Merging result files 6 years 2 months ago #31444

  • Taro47
  • Taro47's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 32
No, I am talking about two telemac 2d files.

My computation stopped at t=111600s because my computer restarted.

So, I used gretel.exe to have a restart file, and I have computed a new simuation from t=111600s to the end.

Now, I wish to merge these two .res files.
The administrator has disabled public write access.

Merging result files 6 years 2 months ago #31445

  • Mustermann
  • Mustermann's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 268
  • Thank you received: 4
Ahh ok, not sure if this works, since gretel is used to merge files from different cores, but you like to merge two simulation results.
What you could do is use result 1 t=0 until t=111600s as input for the model of result 2 with the keyword COMPUTATION CONTINUED, but you would need to run simulation part two again.

Regards,
Clemens
The administrator has disabled public write access.

Merging result files 6 years 2 months ago #31450

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Hello,

Some (long) time ago I wrote a Matlab script to do just that (see attachment). If you use Matlab you can probably use it directly, or you can translate it to some other language.

Suppose you have two files named "part_1.slf" and "part_2.slf", then you call the script with
slfcat('part_*.slf','all_parts.slf')

It should work.

I haven't used it in a while though. After some time using this I realized that this approach is inconvenient for a number of reasons.

The first one is that if your simulation produces large files, the merged result will be even larger. And managing two large files is easier than managing one humongous file. I say this because I got to the point where I had about 15 files per simulation.

The second reason is that if one of them gets corrupted, you only need to simulate that part again. If the merged result gets corrupted, then it will be hard to restore it.

Of course, if you use BlueKenue to extract averages, for example, then you have to merge them. This is the reason I made the script.

Use it as it best fits you, but I wouldn't recommend deleting the "part_*.slf" after they are merged :)

(renamed the script from slfcat.m to slfcat.txt because the forum doesn't allow certain extensions)

File Attachment:

File Name: slfcat.txt
File Size: 5 KB
The administrator has disabled public write access.
The following user(s) said Thank You: Taro47

Merging result files 6 years 2 months ago #31451

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
You can use the python script merge.py that is in telemac.
It will do exactly what your asking for.
Run it with -h to see the options.
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: Phelype, Taro47, Mustermann

Merging result files 6 years 2 months ago #31456

  • Taro47
  • Taro47's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 32
Thanks a lot Yugi, it works.

Regards,

Nicolas
The administrator has disabled public write access.

Merging result files 6 years 1 month ago #31775

  • Yunhao Song
  • Yunhao Song's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 118
  • Thank you received: 9
Dear Yugi,

Could you show me how to merge the results of HPC queue[hydra]? I tried gretel.py but it gives the error below:
$gretel.py --geo-file=T3DGEO --res-file=T3DRES --ncsize=10 --bnd-file=T3DCLI --nplan=14

Loading Options and Configurations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... parsing configuration file: /home/yhsong/TELEMAC/v7p3r1/configs/systel.cis-hydra.cfg
Traceback (most recent call last):
File "/home/yhsong/TELEMAC/v7p3r1/scripts/python27/gretel.py", line 123, in <module>
if 'root' not in cfgs[args.configName]:
KeyError: ''

Regards,
Yunhao
The administrator has disabled public write access.

Merging result files 6 years 1 month ago #31776

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
You are missing the options -r <path_to_telemac>
or setting the envrionement variable HOMETEL to <path_to_telemac>

One of the two will do the trick.
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.

Merging result files 6 years 1 month ago #31777

  • Yunhao Song
  • Yunhao Song's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 118
  • Thank you received: 9
Thank you for the reply, but the envrionement variable HOMETEL was set in bash file, and I tried to add the -r<path_to_telemac> but didn't work, same error showed up.. :(
The administrator has disabled public write access.

Merging result files 6 years 1 month ago #31778

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 244
I misread the error adding -c configName should solve it
Or setting USETELCFG to configname.
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: Yunhao Song
Moderators: pham

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