MATLAB 2017b - problem executing mex file with omp parallel

I have mex a file written in c++ using openmp (#pragma omp parallel). The mex file is compiled with visual studio 2013 and it works fine with 2015b,and 2016b. However, when I tried to run it using Matlab 2017, it stopped executing the Mex file. I have compiled the mex file with visual studio 2017 version. Still, the problem exited. After debugging, I realise that the mex file works fine in Matlab 2017 when I have used single thread. When I increase the thread number from 1 to 2 or 3, it somehow loses the thread id during the execution, and throws error. I have tried different mex files (which worked fine in 2015b with multi-thread), but every file fails to execute in Matlab 2017.
It would be much appreciated if anybody could provide any insight to fix the problem.
Thanks and Regard, Arnab

2 件のコメント

James Tursa
James Tursa 2018 年 4 月 12 日
編集済み: James Tursa 2018 年 4 月 12 日
I've got a C mex routine that uses OpenMP. It was compiled on an earlier version of MATLAB (I don't recall which one) and still appears to work fine in R2017b. Win64. MSVS 2013 Pro.
arnab palit
arnab palit 2018 年 4 月 16 日
編集済み: arnab palit 2018 年 4 月 16 日
Dear James,
Thank you. Could you please send me, if possible, one exemplary source code of mex file which works both in Matlab 2015b and 2017b using OpenMP multi-thread environemnt.
Thanks and Regards,
Arnab

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

質問済み:

2018 年 4 月 12 日

編集済み:

2018 年 4 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by