warning: could not get change notification handle when using matlab distributed computing toolbox
2 次查看(过去 30 天)
显示 更早的评论
I have a MATLAB program that is used to run a .exe and work with the text file that the executable puts out. In order to run the .exe, two input text files need to be written as well. As a result, there's a lot of text file reading and writing that I can't avoid. In order to make the process faster, since this needs to be done >1000 times, I use a parfor loop. To avoid issues with two workers trying to write to the same file, I have made sure that every file that is written has a unique name so that it can't be overwritten. Additionally, I delete or move the input files I no longer need so they don't clutter up the directory they're in. I also make sure to use fclose any time I read or write to a file so there shouldn't be any open files. Even still, after a while the rate at which the tasks are completed slows down and I get the warning as in the title. Is there anything I can do besides modifying my startup.m (which I am loathe to do) to avoid getting the warning?
I'm thinking that the issue is latency between the server where the files are located so the change notification handles aren't running out but rather are not being recieved in time. I have read the help for change notifications but it hasn't really given me any insght beyond what I've already said. My only possible solution would be to add a pause for a few milliseconds in the loop so that the change notifications can arrive but that is obviously not preferable since every millisecond counts when doing thousands to loop iterations.
Here is some pseudocode of what I'm doing. All of my variables should be properly sliced to minimize communication overhead as well.
parfor run = 1:1:runs
inputfiles = writeinput(args)
[~,~] = system('program.exe < ' inputfiles)
outputfilesmoved = moveoutput(outputfiles)
newoutputfile = reformatoutput(outputfilesmoved)
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!