It might depend upon whether you are using spmd compared to parfor or parfeval, but generally MATLAB creates Java task queues for parfor and parfeval work. The calls to create those do not deliberately pass in information about which CPU is being executed on -- which is something that could change without notice as MATLAB itself does not bind in an affinity for the core it starts executing on.
As best I can tell, scheduling and cpu affinity is all left to the operating system. Operating systems will tend to distribute tasks to cores that are idle, and operating systems contain logic for process migration. The operating system might or might not be configured to retain locality (that is, reduce process migration.)
If you are using parfeval() then instead of having the process write the result to the file, return the result and have the client fetch that from the future and write it to the file.
Best Answer