mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Add a check for environmental variable TIPPECANOE_MAX_THREADS
This commit is contained in:
@@ -147,6 +147,12 @@ resolution is obtained than by using a smaller _maxzoom_ or _detail_.
|
|||||||
* -pt or --no-tiny-polygon-reduction: Don't combine the area of very small polygons into small squares that represent their combined area.
|
* -pt or --no-tiny-polygon-reduction: Don't combine the area of very small polygons into small squares that represent their combined area.
|
||||||
* -q or --quiet: Work quietly instead of reporting progress
|
* -q or --quiet: Work quietly instead of reporting progress
|
||||||
|
|
||||||
|
Environment
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Tippecanoe ordinarily uses as many parallel threads as the operating system claims that CPUs are available.
|
||||||
|
You can override this number by setting the `TIPPECANOE_MAX_THREADS` environmental variable.
|
||||||
|
|
||||||
Example
|
Example
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,14 @@ void checkdisk(struct reader *r, int nreader) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void init_cpus() {
|
void init_cpus() {
|
||||||
|
const char *TIPPECANOE_MAX_THREADS = getenv("TIPPECANOE_MAX_THREADS");
|
||||||
|
|
||||||
|
if (TIPPECANOE_MAX_THREADS != NULL) {
|
||||||
|
CPUS = atoi(TIPPECANOE_MAX_THREADS);
|
||||||
|
} else {
|
||||||
CPUS = sysconf(_SC_NPROCESSORS_ONLN);
|
CPUS = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
}
|
||||||
|
|
||||||
if (CPUS < 1) {
|
if (CPUS < 1) {
|
||||||
CPUS = 1;
|
CPUS = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,10 @@ which may not be what you want.
|
|||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\-q or \-\-quiet: Work quietly instead of reporting progress
|
\-q or \-\-quiet: Work quietly instead of reporting progress
|
||||||
.RE
|
.RE
|
||||||
|
.SH Environment
|
||||||
|
.PP
|
||||||
|
Tippecanoe ordinarily uses as many parallel threads as the operating system claims that CPUs are available.
|
||||||
|
You can override this number by setting the \fB\fCTIPPECANOE_MAX_THREADS\fR environmental variable.
|
||||||
.SH Example
|
.SH Example
|
||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
|
|||||||
Reference in New Issue
Block a user