Scratch files with spmd

4 visualizzazioni (ultimi 30 giorni)
Amit Padhi
Amit Padhi il 9 Gen 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.

Risposta accettata

Walter Roberson
Walter Roberson il 9 Gen 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.

Più risposte (0)

Categorie

Scopri di più su Parallel for-Loops (parfor) in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by