Scratch files with spmd

4 Ansichten (letzte 30 Tage)
Amit Padhi
Amit Padhi am 9 Jan. 2018
Bearbeitet: Walter Roberson am 9 Jan. 2018
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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Jan. 2018
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.

Weitere Antworten (0)

Kategorien

Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by