Skip to content
Snippets Groups Projects

size_t

Merged Pedro Gonnet requested to merge size_t into master

As per #70 (closed), we will run into problems with more than 2bn particles per node as all the particle counters and loop variables are currently int.

As a first step, switch the stored particle counts to size_t.

The next series of commits will be to change all the loops over the particles. I'm breaking this into two pieces since these changes are highly disruptive, especially since I'm submitting them along with !113 (merged).

Merge request reports

Merged by avatar (May 25, 2025 6:26pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I'm not clear from the description. Is this merge ready to go?

  • Author Developer

    Yes, it didn't seem to break anything on my side, but I've been wrong about that before ;)

  • Peter W. Draper Added 1 commit:

    Added 1 commit:

  • I'm seeing a crash at:

    #0  0x0000000000406a42 in space_gparts_sort (gparts=0x2ae196d8d040, ind=0x3979cf0, N=0, min=0, max=14399)
        at space.c:744
    #1  0x00000000004058ca in space_rebuild (s=0x7fff98490040, cell_max=0, verbose=0) at space.c:441
    #2  0x000000000043e1d9 in engine_rebuild (e=0x7fff98490220) at engine.c:1201
    #3  0x000000000043e30f in engine_prepare (e=0x7fff98490220) at engine.c:1250
    #4  0x000000000043eb02 in engine_init_particles (e=0x7fff98490220) at engine.c:1419
    #5  0x0000000000403eb8 in main (argc=15, argv=0x7fff98490548) at main.c:492

    with the following variables:

    qstack = 0x414a100
    qstack_size = 28808
    first = 1
    last = 1
    waiting = 1
    pivot = 7199
    i = 0
    ii = 1024191
    j = 18446744073709551615
    jj = 18446744073709342492
    temp_i = 957597
    qid = 0

    Some of those look unlikely! Does the sorting require a signed int?

  • Author Developer

    Thanks for catching that! I'll switch those around to ptrdiff_t and make sure I don't have any other ugly surprises lurking around.

  • Pedro Gonnet Added 4 commits:

    Added 4 commits:

    • ad521238 - changes pointed out by matthieu.
    • d45fd673 - fix output formatting.
    • 1783cab7 - use ptrdiff_t instead of size_t where appropriate.
    • a614a343 - Merge branch 'size_t' of gitlab.cosma.dur.ac.uk:swift/swiftsim into size_t
  • Author Developer

    OK, I think I've fixed it now. Can you git it another try? Thanks!

  • Pedro Gonnet mentioned in merge request !113 (merged)

    mentioned in merge request !113 (merged)

  • Thanks, seems to compile and run without any issues, so accepting.

    OK to delete the branch?

  • Peter W. Draper mentioned in commit 1f9e985c

    mentioned in commit 1f9e985c

  • Peter W. Draper Status changed to merged

    Status changed to merged

Please register or sign in to reply
Loading