fmihpc / vlasiator

Vlasiator - ten letters you can count on
https://www.helsinki.fi/en/researchgroups/vlasiator
Other
45 stars 37 forks source link

vlsvdiff can't diff extracted velocity spaces anymore #562

Open ursg opened 3 years ago

ursg commented 3 years ago

We just found that vlsvdiff can't handle extracted velocity space meshes anymore:

$ ~/vlasiator/vlsvextract_DP "fullf.0000000.vlsv" --cellid 1
Save path: 
Total number of extractions: 1
Cell id: 1
         extracted from 'fullf.0000000.vlsv'

$ ~/vlasiator/vlsvextract_DP "fullf.0000001.vlsv" --cellid 1
Save path: 
Total number of extractions: 1
Cell id: 1
         extracted from 'fullf.0000001.vlsv'

$ ~/vlasiator/vlsvdiff_DP --diff --meshname=VelGrid_proton velgrid* proton 0
VelGrid_proton
Wrong grid type
[ursamajor:02275] *** Process received signal ***
[ursamajor:02275] Signal: Aborted (6)
[ursamajor:02275] Signal code:  (-6)
[ursamajor:02275] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3a100)[0x7fe94af75100]
[ursamajor:02275] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141)[0x7fe94af75081]
[ursamajor:02275] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x121)[0x7fe94af60535]
[ursamajor:02275] [ 3] /home/urs/vlasiator/vlsvdiff_DP(+0x15e78)[0x560042a8fe78]
[ursamajor:02275] [ 4] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7fe94af61bbb]
[ursamajor:02275] [ 5] /home/urs/vlasiator/vlsvdiff_DP(_start+0x2a)[0x560042a93cba]
[ursamajor:02275] *** End of error message ***

The culprit is, aparently, here: https://github.com/fmihpc/vlasiator/blob/master/tools/vlsvdiff.cpp#L1791 Since the velocity grid names is not known to vlsvdiff (since it's recent change), it refuses to work with velgrids.

I guess the obvious solution would be to add a gridType velgrid (that is matched by any "VelGrid_*" mashname parameter) and describe the behaviour for those?

markusbattarbee commented 3 years ago

Markku and I hit this wall a few weeks ago with electrons but didn't realize that was the issue - a fix would be great indeed! Probably won't have time to look at this for a while though...

ursg commented 2 years ago

626 fixes this.