필터 지우기
필터 지우기

isvalid() and distributed data

조회 수: 3 (최근 30일)
Karl
Karl 2016년 3월 10일
Why isn't "isvalid()" defined for distributed data?
Distributing large data sets among parallel workers can take up to several minutes. If a valid copy of distributed data already exists on the workers, there is no need to distribute it again and it's preferable to skip that operation.
When a parallel pool is deleted, the distributed data that resided on the workers (understandably) goes invalid, but the variable still remains in the workspace. If you query isreal() on the data, Matlab specifically states that the data is not valid. Opening a new pool does not make the data valid - the data has to be distributed again, among the workers in the new pool.
Unfortunately, the isvalid() function is not defined for a distributed array. Currently, there is no function or method to determine if the existing distributed variable is valid. The only approach I can find is to run a try-catch trap. I query isreal() and trap any resulting error message, looking for the key word "invalid." If this occurs, I simply run distribute() to get the data distributed again.
The "isvalid()" method should be defined for distributed arrays, making it possible to catch errors before attempting to use a variable.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Parallel Server에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by