pyspark.BarrierTaskContext.cpus#

BarrierTaskContext.cpus()#

CPUs allocated to the task, rounded up to a whole number when the exact allocation is fractional. Use TaskContext.cpuAmount() to get the exact, possibly fractional, amount.

Returns:
int

the number of CPUs.