Implement threading for island constraint solving.

Humanoids22 No threads:
 Benchmark Execution Time: 9.475905812s

Humanoids22 with 10 Threads:
 Benchmark Execution Time: 4.871352s

PiperOrigin-RevId: 571214307
Change-Id: I1f4f2c761b4ae6bc8fac1f28c6c695f6c499f339
This commit is contained in:
Matthew Bennice
2023-10-05 21:04:39 -07:00
committed by Copybara-Service
parent 06670155c4
commit 071af3b015
20 changed files with 3667 additions and 30 deletions
+5 -2
View File
@@ -14,6 +14,7 @@
#include "engine/engine_collision_driver.h"
#include <math.h>
#include <stddef.h>
#include <string.h>
@@ -61,8 +62,10 @@ static void collideGeoms(const mjModel* m, mjData* d,
static inline void resetArena(mjData* d) {
d->parena = d->ncon * sizeof(mjContact);
#ifdef ADDRESS_SANITIZER
ASAN_POISON_MEMORY_REGION(
(char*)d->arena + d->parena, d->narena - d->pstack - d->parena);
if (!d->threadpool) {
ASAN_POISON_MEMORY_REGION(
(char*)d->arena + d->parena, d->narena - d->pstack - d->parena);
}
#endif
}