Rename mjMAXTHREADS -> mjMAXTHREAD (consistency).
PiperOrigin-RevId: 599130235 Change-Id: Ia80379b8ae0574a7cd8fbc668657f806e90d6c5c
This commit is contained in:
committed by
Copybara-Service
parent
71b0561758
commit
67a00a3a51
@@ -489,7 +489,7 @@ shown in the table below. Their names are in the format ``mjKEY_XXX``. They corr
|
|||||||
- 1000
|
- 1000
|
||||||
- Maximum number of textures allowed.
|
- Maximum number of textures allowed.
|
||||||
Defined in `mjrender.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjrender.h>`_.
|
Defined in `mjrender.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjrender.h>`_.
|
||||||
* - ``mjMAXTHREADS``
|
* - ``mjMAXTHREAD``
|
||||||
- 128
|
- 128
|
||||||
- Maximum number OS threads that can be used in a thread pool.
|
- Maximum number OS threads that can be used in a thread pool.
|
||||||
Defined in `mjthread.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjthread.h>`_.
|
Defined in `mjthread.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjthread.h>`_.
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ struct mjData_ {
|
|||||||
|
|
||||||
// memory utilization stats
|
// memory utilization stats
|
||||||
size_t maxuse_stack; // maximum stack allocation in bytes
|
size_t maxuse_stack; // maximum stack allocation in bytes
|
||||||
size_t maxuse_threadstack[mjMAXTHREADS]; // maximum stack allocation per thread in bytes
|
size_t maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
||||||
size_t maxuse_arena; // maximum arena allocation in bytes
|
size_t maxuse_arena; // maximum arena allocation in bytes
|
||||||
int maxuse_con; // maximum number of contacts
|
int maxuse_con; // maximum number of contacts
|
||||||
int maxuse_efc; // maximum number of scalar constraints
|
int maxuse_efc; // maximum number of scalar constraints
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ struct mjData_ {
|
|||||||
|
|
||||||
// memory utilization stats
|
// memory utilization stats
|
||||||
size_t maxuse_stack; // maximum stack allocation in bytes
|
size_t maxuse_stack; // maximum stack allocation in bytes
|
||||||
size_t maxuse_threadstack[mjMAXTHREADS]; // maximum stack allocation per thread in bytes
|
size_t maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
||||||
size_t maxuse_arena; // maximum arena allocation in bytes
|
size_t maxuse_arena; // maximum arena allocation in bytes
|
||||||
int maxuse_con; // maximum number of contacts
|
int maxuse_con; // maximum number of contacts
|
||||||
int maxuse_efc; // maximum number of scalar constraints
|
int maxuse_efc; // maximum number of scalar constraints
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#ifndef MUJOCO_INCLUDE_MJTHREAD_H_
|
#ifndef MUJOCO_INCLUDE_MJTHREAD_H_
|
||||||
#define MUJOCO_INCLUDE_MJTHREAD_H_
|
#define MUJOCO_INCLUDE_MJTHREAD_H_
|
||||||
|
|
||||||
#define mjMAXTHREADS 128 // maximum number of threads in a thread pool
|
#define mjMAXTHREAD 128 // maximum number of threads in a thread pool
|
||||||
|
|
||||||
typedef enum mjtTaskStatus_ { // status values for mjTask
|
typedef enum mjtTaskStatus_ { // status values for mjTask
|
||||||
mjTASK_NEW = 0, // newly created
|
mjTASK_NEW = 0, // newly created
|
||||||
|
|||||||
@@ -739,7 +739,7 @@
|
|||||||
|
|
||||||
// vector fields of mjData
|
// vector fields of mjData
|
||||||
#define MJDATA_VECTOR \
|
#define MJDATA_VECTOR \
|
||||||
X( size_t, maxuse_threadstack, mjMAXTHREADS, 1 ) \
|
X( size_t, maxuse_threadstack, mjMAXTHREAD, 1 ) \
|
||||||
X( mjWarningStat, warning, mjNWARNING, 1 ) \
|
X( mjWarningStat, warning, mjNWARNING, 1 ) \
|
||||||
X( mjTimerStat, timer, mjNTIMER, 1 ) \
|
X( mjTimerStat, timer, mjNTIMER, 1 ) \
|
||||||
X( mjSolverStat, solver, mjNILSAND, mjNSOLVER ) \
|
X( mjSolverStat, solver, mjNILSAND, mjNSOLVER ) \
|
||||||
|
|||||||
@@ -1568,7 +1568,7 @@ static void _resetData(const mjModel* m, mjData* d, unsigned char debug_value) {
|
|||||||
|
|
||||||
// clear memory utilization stats
|
// clear memory utilization stats
|
||||||
d->maxuse_stack = 0;
|
d->maxuse_stack = 0;
|
||||||
mju_zeroSizeT(d->maxuse_threadstack, mjMAXTHREADS);
|
mju_zeroSizeT(d->maxuse_threadstack, mjMAXTHREAD);
|
||||||
d->maxuse_arena = 0;
|
d->maxuse_arena = 0;
|
||||||
d->maxuse_con = 0;
|
d->maxuse_con = 0;
|
||||||
d->maxuse_efc = 0;
|
d->maxuse_efc = 0;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class ThreadPoolImpl : public mjThreadPool {
|
|||||||
public:
|
public:
|
||||||
ThreadPoolImpl(int num_worker) : mjThreadPool{num_worker} {
|
ThreadPoolImpl(int num_worker) : mjThreadPool{num_worker} {
|
||||||
// initialize worker threads
|
// initialize worker threads
|
||||||
for (int i = 0; i < std::min(num_worker, mjMAXTHREADS); ++i) {
|
for (int i = 0; i < std::min(num_worker, mjMAXTHREAD); ++i) {
|
||||||
WorkerThread worker{
|
WorkerThread worker{
|
||||||
std::make_unique<std::thread>(ThreadPoolWorker, this, i)};
|
std::make_unique<std::thread>(ThreadPoolWorker, this, i)};
|
||||||
workers_.push_back(std::move(worker));
|
workers_.push_back(std::move(worker));
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public const bool THIRD_PARTY_MUJOCO_MJRENDER_H_ = true;
|
|||||||
public const int mjNAUX = 10;
|
public const int mjNAUX = 10;
|
||||||
public const int mjMAXTEXTURE = 1000;
|
public const int mjMAXTEXTURE = 1000;
|
||||||
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTHREAD_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTHREAD_H_ = true;
|
||||||
public const int mjMAXTHREADS = 128;
|
public const int mjMAXTHREAD = 128;
|
||||||
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTNUM_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTNUM_H_ = true;
|
||||||
public const bool mjUSEDOUBLE = true;
|
public const bool mjUSEDOUBLE = true;
|
||||||
public const double mjMINVAL = 1e-15;
|
public const double mjMINVAL = 1e-15;
|
||||||
|
|||||||
Reference in New Issue
Block a user