ascot4fusion / ascot5

ASCOT5 is a high-performance orbit-following code for fusion plasma physics and engineering
https://ascot4fusion.github.io/ascot5/
GNU Lesser General Public License v3.0
31 stars 9 forks source link

Changed ints to size_ts in diagnostics to support large arrays #46

Closed miekkasarki closed 12 months ago

miekkasarki commented 12 months ago

All diagnostics now use size_t instead of int whenever arrays are indexed or allocated. I also included these changes to AFSI since it uses the same distributions as the main program.

I didn't change the array dimensions from int to size_t since for those int should be sufficient (and the dimensions are stored as ints in the HDF5 anyway). To avoid zillion (size_t) casts, I introduced new parameters to the distribution structs that define row, column, etc. sizes in size_t's.

@rui-coelho could you checkout branch https://github.com/ascot4fusion/ascot5/tree/hotfix/45-support-for-large-arrays and verify that now you can use large distributions both in bbnbi5 and ascot5_main?

rui-coelho commented 12 months ago

worked just fine. I could "easily" use a grid of

"DIST_MIN_R":min_R,    "DIST_MAX_R":max_R,    "DIST_NBIN_R":100,
"DIST_MIN_PHI":0,    "DIST_MAX_PHI":360,  "DIST_NBIN_PHI":80,
"DIST_MIN_Z":min_Z,   "DIST_MAX_Z":max_Z,    "DIST_NBIN_Z":120,
"DIST_MIN_PPA":-max_p, "DIST_MAX_PPA":max_p,  "DIST_NBIN_PPA":100,
"DIST_MIN_PPE":0,    "DIST_MAX_PPE":max_p, "DIST_NBIN_PPE":100,

whereas before i was limited to maximum of ~70

miekkasarki commented 12 months ago

Then let's consider this one fixed.