Trying to read text file inside parfor loop versus passing it as a parameter
Ältere Kommentare anzeigen
I have a couple txt/csv files that contain upward to 5000 lines. Each line contains information that I intend to read in as input to a function inside parfor loop. Is it best if I read the text files as a matrix/struct/etc. and the parfor loop can access the information from said matrix/struct? Or is it better have the part that read files inside the parfor loop?
3 Kommentare
Mohammad Sami
am 24 Mär. 2020
Does each loop operate on a different file ?
Giang Le
am 24 Mär. 2020
Mohammad Sami
am 24 Mär. 2020
Bearbeitet: Mohammad Sami
am 24 Mär. 2020
I suggest just load it once before parfor loop. As long as each loop is not modifying the contents, it should be fine.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Parallel for-Loops (parfor) finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!