Scratch files with spmd

4 visualizaciones (últimos 30 días)
Amit Padhi
Amit Padhi el 9 de En. de 2018
Editada: Walter Roberson el 9 de En. de 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.

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de En. de 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.

Más respuestas (0)

Categorías

Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by