pmap usage pmap(xxxx,i) where i is large than nprocs

pmap

#1

Hello.

I use pmap to calculate Jacobian matrix by multi-colored finite differences.
My Jacobians are large and sparse. Thus, there are approximately 18 colors.

Following is the line that computes all colors(colums).

Jacobian = pmap(j -> ( F(u + colors[:,j], Fparam, Si) - FATu ) / epsilon, 1:cn)

where cn is the number of colors.

When nprocs() are less then cn, my code stops doing its work and all cores become 0% and nothing happens.
Simply code becomes as it is paused.

I dont not want to use 18 procs because of the memory considerations.
Each proc uses nearly 400-700 mb memory in my complicated and large system solver code.

How can use pmap with 4 nprocs where cn is more than 4?