Creating table columns in a parfor loop

Found this buggy behaviour when creating tables in a parfor loop. The first example (doesn't work) causes the parallel pool worker to crash and gives a "Segmentation Violation" error in the crash dump file. However, in the second example (works), including any character that needs escaping (i.e. -, +, etc) in the table column title avoids the error.
%doesnt work
parpool('local', 1);
parfor i=1
temptab = table();
temptab.('var1') = ['a';'b'];
end
%works
parpool('local', 1);
parfor i=1
temptab = table();
temptab.('var-1') = ['a';'b'];
end

댓글 수: 6

Matt J
Matt J 2024년 1월 7일
Something in your environment. Both work fine for me.
I tried this with R2023b on Windows 11 and the first example crashed for me as well. Which versions/OS are you guys running @asdfg asdfg @Matt J?
@Raymond Norris First example crashes for me as well, also on R2023b and Win 11. The R2024a Prerelease works for me correctly however
asdfg asdfg
asdfg asdfg 2024년 1월 9일
I tried on Mac on R2023b
Matt J
Matt J 2024년 1월 9일
R2023b Windows 10.
Raymond Norris
Raymond Norris 2024년 1월 10일
Good thought, @Damian Pietrus. R2024a prerelease also works for me. So,
@asdfg asdfg has problems with R2023b (Mac)
@Damian Pietrus and @Raymond Norris have problems with R2023b (Windows 11)
@Matt J works fine with R2023b (Windows 10)
My next thought is the release Update. But I'm runnig GR (Update 0) and Damian's running the latest (Update 5).
@asdfg asdfg if you need this working on macOS R2023b, I'd suggest contacting MathWorks Technical Support. Otherwise, consider trying R2024a Prerelease.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

2024년 1월 6일

댓글:

2024년 1월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by