Software Archive
Read-only legacy content
17060 Discussions

multiple cilk-for in a c function

newport_j
Beginner
1,219 Views


it is clear how to use cilkview in a c function. One just places cilkview.h in the include file secton, put __cilk_data_t start in the file defintion section of the c function. Finallly, puting __cilkview_query(strat); in the line above the cilk_for loop and at the end put __cilkview_report(&start,NULL,"title",CV_REPORT_WRITE_TO_RESULTS); at the bottom ogf the file.

NowI attempting to speed up only with cilk_for's, andI have set up each function as I have shown above.

But,I want to check to the contributionof each cilk_for and there may be more than one cilk_for in a function. All,I can do is check the whole function, noteach cilk-for.How do I do the latter.

Thanks in advance.

Newport_j
0 Kudos
1 Reply
Georg_Z_Intel
Employee
1,219 Views
Hello,

only code executed between __cilkview_query(...) and __cilkview_report(...) will be analyzed.

So, why don't you just enclose one for-loop by those two statements, e.g.:
[cpp]void foo() { ... cilk_for(...) { } ... __cilkview_query(...); cilk_for(...) { } __cilkview_report(...); }[/cpp] ...to just analyze the second for-loop.

Of course you need to make sure you don't mix the results of multiple invocations of the function (here: foo())! You can do this by either bailing-out early after having the first report or by using different tags.

Best regards,

Georg Zitzlsberger
0 Kudos
Reply