是否可以并行运行一个必须在当前目录中读取具有固定名称的输入文件的可执行文件?

时间:2015-08-05 19:16:28

标签: matlab parallel-processing

我有一个可执行文件" myprog.exe"它读取文本文件" input.in"并给出输出文件" output.ov"。 我想使用matlab脚本和并行工具箱并行运行该程序。

我尝试了以下内容:

% open a 6-worker pool with 'write_input.m' as dependency
parpool(6,'AttachedFiles','write_input.m')

parfor ii = 1:100

    % write input.in with the ii-th parameter set
    write_input(ii); 

    % run myprog.exe for the ii-th parameter set
    runprog = which( 'prog.exe' );
    eval(['!"' runprog '" ']);

end % ..ii

但它不起作用,因为当工人试图读/写"输入时会发生冲突。"我最终得到了无效的文件标识符错误。

然后我想知道是否有一个明显的解决方案,我不知道或解决这个问题。

最后的事情:

  • 我没有此可执行文件的源代码;
  • 该计算机正在Windows
  • 下运行

提前感谢您的帮助。

0 个答案:

没有答案