The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Limit the number of threads used by immunarch

What is happening under the hood?

immunarch uses immundata, which uses duckplyr, which runs queries in DuckDB. It is quite a journey from the data to your plots.

DuckDB can use many CPU cores by default to run faster, but sometimes you want to limit this.

Why limit threads?

How to limit the number of threads

Put this near the start of your tutorial/script:

# Limit the number of CPU threads used by DuckDB in this R session
duckplyr::db_exec("SET threads TO 1")

Change later (example: use 4 threads) or reset to default:

duckplyr::db_exec("SET threads TO 4")   # use 4 threads
# or, if supported in your environment:
duckplyr::db_exec("RESET threads")      # back to DuckDB default

References

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.