diff --git a/doc/programming/samples.rst b/doc/programming/samples.rst index 122867ee..4870bd92 100644 --- a/doc/programming/samples.rst +++ b/doc/programming/samples.rst @@ -49,7 +49,7 @@ Where the command-line options and arguments are * - ``--noiserate=X`` - 0.1 - rate of convergence to ctrl keyframe/midpoint - * - ``--npoolthread=N`` + * - ``--nenginethread=N`` - 0 - number of threads in engine-internal threadpool * - ``--solver=S`` @@ -89,9 +89,9 @@ Where the command-line options and arguments are specified on the command line; otherwise, the model options configured in the XML file are preserved. - The control noise arguments (``noisestd`` and ``noiserate``) prevent models from settling into a static state where, due to warmstarts, one can measure artificially faster simulation. -- When ``npoolthread > 1`` is specified, an engine-internal thread pool is created with the specified number of +- When ``nenginethread > 1`` is specified, an engine-internal thread pool is created with the specified number of threads, to speed up simulation of large scenes. Note that while it is possible to use both ``nthread`` and - ``npoolthread``, the scenarios for which one would want these different types of multithreading are usually mutually + ``nenginethread``, the scenarios for which one would want these different types of multithreading are usually mutually exclusive. - For more repeatable performance statistics, run the tool with the ``performance`` `governor `__ on Linux, or the diff --git a/sample/testspeed.cc b/sample/testspeed.cc index 4dc86dbf..0fa5c4c1 100644 --- a/sample/testspeed.cc +++ b/sample/testspeed.cc @@ -303,7 +303,7 @@ int main(int argc, char** argv) { " --nthread=N 1 number of threads running parallel rollouts\n" " --noisestd=X 0.01 scale of pseudo-random noise injected into actuators\n" " --noiserate=X 0.1 rate of convergence to ctrl keyframe/midpoint\n" - " --npoolthread=N 0 number of threads in engine-internal threadpool\n" + " --nenginethread=N 0 number of threads in engine-internal threadpool\n" " --solver=S Newton PGS, CG, Newton\n" " --cone=C Pyramidal Pyramidal, Elliptic\n" " --jacobian=J Auto Dense, Sparse, Auto\n" @@ -317,7 +317,7 @@ int main(int argc, char** argv) { "Note: If the model has a keyframe named \"test\", it will be loaded prior to simulation\n"; // default values - int nstep = 10000, nthread = 0, npoolthread = 0; + int nstep = 10000, nthread = 0, nenginethread = 0; // inject small noise by default, to avoid fixed contact state double noisestd = 0.01; double noiserate = 0.1; @@ -367,9 +367,9 @@ int main(int argc, char** argv) { if (std::sscanf(val, "%lf", &noiserate) != 1) { return finish("Invalid --noiserate argument"); } - } else if ((val = getarg("npoolthread"))) { - if (std::sscanf(val, "%d", &npoolthread) != 1) { - return finish("Invalid --npoolthread argument"); + } else if ((val = getarg("nenginethread"))) { + if (std::sscanf(val, "%d", &nenginethread) != 1) { + return finish("Invalid --nenginethread argument"); } } else if ((val = getarg("solver"))) { int parsed = ParseEnum(val, {"PGS", "CG", "Newton"}); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { // clamp nthread to [1, maxthread] nthread = mjMAX(1, mjMIN(maxthread, nthread)); - npoolthread = mjMAX(1, mjMIN(maxthread, npoolthread)); + nenginethread = mjMAX(1, mjMIN(maxthread, nenginethread)); // get filename, determine file type std::string filename(model); @@ -483,8 +483,8 @@ int main(int argc, char** argv) { } // make and bind threadpool - if (npoolthread > 1) { - mju_threadpool(runner.d[id], npoolthread); + if (nenginethread > 1) { + mju_threadpool(runner.d[id], nenginethread); } } @@ -506,8 +506,8 @@ int main(int argc, char** argv) { } // print thread pool size - if (npoolthread > 1) { - std::printf(", using %d threads", npoolthread); + if (nenginethread > 1) { + std::printf(", using %d threads", nenginethread); } std::printf("...\n");