Error using parfoor: interactive sessions

Hello guys,
please is it a good practice to have two parfor loops execute in the same function? For example, I have:
parfor slice_num = 1:number_of_labs
.
.
.
end
.
.
.
parfor slice_num = 1:number_of_labs
.
.
.
end
Now, my problem is that it generates an error stating: "Found an interactive session. You cannot have multiple interactive sessions open simultaneously. To terminate the existing session, use 'delete(gcp)'"
Please, you guys, what should I do to resolve this error?
Thank you for your assistant.

댓글 수: 5

Adam
Adam 2015년 9월 30일
There shouldn't be any reason why you can't do this. I had a play around with my parallel preferences, but couldn't repeat your error. It should open a pool (if one isn't open and it is set to automatically open the pool) at the first parfor then it will keep this pool open for the length of time specified in your preferences and when you run the second parfor, if that first pool is still open it should just use it rather than trying to open another pool.
Egena Onu
Egena Onu 2015년 9월 30일
Thank you so much Adam. I really appreciate your quick response. I got round it some how using gcp().
Thanks a lot.
Edric Ellis
Edric Ellis 2015년 9월 30일
Were you originally calling parpool multiple times? That might give an error of that sort.
Mohammad Aref
Mohammad Aref 2017년 9월 3일
As Edric stated, I encountered the same error by calling parpool for the second time.
I had this error message when multiple defintion of parpool occurs, which is not allowed in Matlab.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

태그

질문:

2015년 9월 30일

댓글:

2018년 1월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by