TRQ-2292: Properly calculate tasks count from nodes resource.

Calculate job's total ppn if hosts resource is specified.
Unit test.