Scratch files with spmd
4 ビュー (過去 30 日間)
古いコメントを表示
If I write a scratch file within an spmd block, will the file be written to a temporary folder in a worker that gets automatically removed after deleting pool?
[Merged from duplicate]
While using spmd on a cluster, I need to write some scratch files within the spmd block. If I use fopen and fwrite commands to write such files, how do i remove the scratch files after execution of my code. I assume all workers write their own files.
0 件のコメント
採用された回答
Walter Roberson
2018 年 1 月 9 日
How would you create the scratch file?
If you use tempname() or tempdir() and create files yourself in there, then the answer is NO, files in tempdir() are only removed whenever the operating system or user or system optimization software decides to remove them.
I do recall encountering one set of code that took care to put in an onCleanup() for a temporary file, but I have forgotten the context. You should consider using onCleanup() for this purpose.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!