I am currently using parfor to process multiple raw data files, in the statement, it first checks if the raw file have already been processed, and only process if it does not see an existing output, like this:
RawDatalist=dir(fullfile(RawDataFolder,'*.txt'));NumRawData=length(RawDatalist);parfor i =1:NumRawData if %output for RawDatalist(i).name already exist
Execute=false; else Execute=true; end if Execute %Process RawDatalist(i).name
end end
Obviously some iterations will take less time than others because there is no calculation involved. I am just wondering if iterations are 1)devided among works at the start of parfor, or 2)handed out one by one once a worker become available? If it's the first case then some workers will be just sitting idle while some others busy working, and I need to move the existance check out of the parfor loop.
Best Answer