ifcconvert: default --threads to auto-detected CPU count (#2709)

The auto-detect path (hardware_concurrency()) already existed for
--threads 0 but was never the default, so users had to pass it
explicitly to get multi-threaded conversion. aothms confirmed in
#2709 this was intended to change for the 0.8 release.

This file was generated with the assistance of an AI coding tool.
This commit is contained in:
Petru Conduraru
2026-07-19 19:54:34 +03:00
parent 89523999b3
commit 7c5b4d60aa
3 changed files with 11 additions and 8 deletions
+3 -2
View File
@@ -297,8 +297,9 @@ int main(int argc, char** argv) {
geom_options.add_options() geom_options.add_options()
("kernel", po::value<std::string>(&geometry_kernel)->default_value(default_kernel), ("kernel", po::value<std::string>(&geometry_kernel)->default_value(default_kernel),
"Geometry kernel to use (opencascade, cgal, cgal-simple, hybrid-cgal-simple-opencascade).") "Geometry kernel to use (opencascade, cgal, cgal-simple, hybrid-cgal-simple-opencascade).")
("threads,j", po::value<int>(&num_threads)->default_value(1), ("threads,j", po::value<int>(&num_threads)->default_value(0),
"Number of parallel processing threads for geometry interpretation.") "Number of parallel processing threads for geometry interpretation. "
"Defaults to 0, which auto-detects the number of concurrent threads supported by the system.")
("center-model", ("center-model",
"Centers the elements by applying the center point of all placements as an offset." "Centers the elements by applying the center point of all placements as an offset."
"Can take several minutes on large models.") "Can take several minutes on large models.")
@@ -16,12 +16,11 @@ you provide for the output file determines what format the IFC is converted to.
On Windows, you can drag and drop a ``.ifc`` file on the ``IfcConvert.exe`` On Windows, you can drag and drop a ``.ifc`` file on the ``IfcConvert.exe``
file to automatically convert it to an ``.obj`` file. file to automatically convert it to an ``.obj`` file.
For any conversion, it is recommended to use multiple cores to speed up By default, IfcConvert uses all available CPU cores to speed up processing. To
processing: use a specific number of threads instead:
.. code-block:: bash .. code-block:: bash
# Change "7" to the number of CPU cores you have then plus one.
IfcConvert -j 7 /path/to/input.ifc /path/to/output.dae IfcConvert -j 7 /path/to/input.ifc /path/to/output.dae
By default, units are converted to meters. If you want to retain the original units: By default, units are converted to meters. If you want to retain the original units:
@@ -112,8 +111,11 @@ CLI Manual
--kernel arg (=opencascade) Geometry kernel to use (opencascade, --kernel arg (=opencascade) Geometry kernel to use (opencascade,
cgal, cgal-simple, hybrid-cgal-simple-o cgal, cgal-simple, hybrid-cgal-simple-o
pencascade). pencascade).
-j [ --threads ] arg (=1) Number of parallel processing threads -j [ --threads ] arg (=0) Number of parallel processing threads
for geometry interpretation. for geometry interpretation. Defaults
to 0, which auto-detects the number
of concurrent threads supported by
the system.
--center-model Centers the elements by applying the --center-model Centers the elements by applying the
center point of all placements as an center point of all placements as an
offset.Can take several minutes on offset.Can take several minutes on
@@ -93,7 +93,7 @@ num_threads
+------+-------------------------+---------+ +------+-------------------------+---------+
| Type | IfcConvert Option | Default | | Type | IfcConvert Option | Default |
+======+=========================+=========+ +======+=========================+=========+
| INT | ``--threads`` or ``-j`` | 1 | | INT | ``--threads`` or ``-j`` | 0 |
+------+-------------------------+---------+ +------+-------------------------+---------+
Number of parallel processing threads for geometry interpretation. Number of parallel processing threads for geometry interpretation.