Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert index order of SOLPS data arrays or make all arrays as column-major #37

Closed
vsnever opened this issue Sep 10, 2020 · 2 comments · Fixed by #35
Closed

Invert index order of SOLPS data arrays or make all arrays as column-major #37

vsnever opened this issue Sep 10, 2020 · 2 comments · Fixed by #35

Comments

@vsnever
Copy link
Member

vsnever commented Sep 10, 2020

The current index order of SOLPS data arrays: (poloidal, radial, species) make sense only for column-major arrays (Fortran-style or F-style), because the species slice is needed more often than the radial slice and the radial slice is needed more often than the poloidal slice.

In the raw simulation files, the arrays are stored in column-major order, and load_b2f_file() and read_block44() return F-style arrays. But on the MDS server they are stored in row-major order (C-style) and with inverse indexing. When reading from MDS, the index order is inverted but the order is not changed from C-style to F-style.

Thus, to improve the performance we should either change the order from C-style to F-style when reading from MDS and also make sure that all arrays created for operation with the SOLPS data arrays are F-style, or to make all arrays C-style and invert the indexing: (species, radial, poloidal). I like the second option better because C-style arrays are default in numpy.

@CnlPepper
Copy link
Member

I would convert everything to row major, i.e. C-style. Unless a mistake has been made everything should be row major in raysect and cherab.

@vsnever
Copy link
Member Author

vsnever commented Apr 6, 2021

Fixed in #35.

@vsnever vsnever closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants