Debugging mapreduce functions in MATLAB

2 ビュー (過去 30 日間)
vthuongt
vthuongt 2015 年 8 月 5 日
コメント済み: Md Shariful Islam 2017 年 4 月 7 日
Hi everyone,
I am trying to debug the standard MapReduce examples of matlab to get a better understanding of the concept. There is also a Mathworks description how to do it http://de.mathworks.com/help/matlab/import_export/debug-mapreduce-algorithms.html. But if I follow the instructions and set the breakpoint and then execute MaxMapReduceExample; the program won't stop. So I can't run the programm line by line. This Problem also arises in other algorithms. But when I write a script and put some breakpoints directly in this script, the execution stops appropriately.
What kind of problem is this? And how can I fix it? Thanks for your time!
  1 件のコメント
vthuongt
vthuongt 2015 年 8 月 5 日
this is a code block I want to debug. edges and name are varaible wich are already defined. I cant set the breakpoint in front of "ourTestMapper" and select Anonymous function, because then the error "cannot enable breakpoints becasue of syntax error." comes. Also breakpoints in my own functions "testReducer" and "testMapper" dont work.
ourTestMapper = @(data, info, intermKVstore) testMapper(data, info, intermKVstore,name , edges);
tic
result = mapreduce(ds, ourTestMapper, @testReducer);
r = readall(result);
toc

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

採用された回答

Tobias Rehder
Tobias Rehder 2016 年 4 月 1 日
編集済み: Tobias Rehder 2016 年 4 月 1 日
Same problem here, using mapreduce in Matlab 2015b! The breakpoint is active when mapreduce is running, but Matlab doesn´t stop when running the codeline where the breakpoint is located in the mapper function.
Tried to reduce the parallel pool to just 1 worker but that didn´t help.
Any suggestions would be appreciated!
Edit:
Found the answer myself: It seems that Matlab cannot consider breakpoints when using a parallel pool. So for me it helped to uncheck the option "Automatically create a parallel pool" in the preferences of the Parallel Computing Toolbox and shutting down all active parallel pools using
p = gcp;
delete(p)
  2 件のコメント
Mininath Bendre
Mininath Bendre 2017 年 3 月 15 日
Thanks, Successfully set breakpoints in MapReduce functions.
Md Shariful Islam
Md Shariful Islam 2017 年 4 月 7 日
Thanks! now its working in Matlab2016b

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

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2015 年 8 月 5 日
Do you have a:
clear all
At the top of your script? This clears break points. Replace it with just:
clear
  1 件のコメント
vthuongt
vthuongt 2015 年 8 月 5 日
編集済み: vthuongt 2015 年 8 月 5 日
No I haven't. I put in a comment. I also included in my own mapper function the line "db stop" but all I get is some output, but the program wont stop.

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

カテゴリ

Help Center および File ExchangeMapReduce についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by