BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.8k stars 122 forks source link

Parallel Delaunay crashes on cube.obj with the Risc-V-64 version #140

Closed BrunoLevy closed 5 months ago

BrunoLevy commented 5 months ago

Parallel Delaunay crashes on cube.obj with the Risc-V-64 version See here (64 Risc-V cores, 8 vertices)

kxxt commented 5 months ago

It also does not crash in riscv64 qemu-user emulation with 32 cpus on a x86_64 host machine. And doesn't crash on the same x86_64 host that has 16 cores and 32 threads.

kxxt commented 5 months ago

And if I force it to use 32 cores by hardcoding it in src/lib/geogram/basic/process_unix.cpp. It also no longer crashes on 64 core riscv64 machine.

kxxt commented 5 months ago

Looks like things already go wrong here:

pool_begin and pool_end are both zeros and due to unsignedness the condition t<pool_end-1 will evaluate to true.

https://github.com/BrunoLevy/geogram/blob/01f95b34bfd0fa2b03d5f86b2a56a35025d86e48/src/lib/geogram/delaunay/parallel_delaunay_3d.cpp#L163-L170

kxxt commented 5 months ago

141 fixes it

BrunoLevy commented 5 months ago

Great, thanks !!!