Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2466 Discussions

flow graph: limiter_node in v4.1 update1 doesn't work as in previous versions

Michael_K_4
Beginner
1,673 Views

Hi there!

In the transition from TBB "4.1" to "4.1 Update 1" something seems to have gone wrong.

Attached is a simple test case (inspired by http://software.intel.com/en-us/blogs/2011/09/14/how-to-make-a-pipeline-with-an-intel-threading-building-blocks-flow-graph).

The program is supposed to generate 100 numbers, let them be squared, and then print the square. The limiter node is set to an arbitrary limit of 7, to limit the number of numbers that are processed in parallel.

I use Visual Studio 2012 to compile this. With TBB V4.1 (20120718) and earlier versions, everything works fine: 100 numbers and their squares are printed. With TBB V4.1 Update 1 (20121003) the program stops after 8 numbers or so. It just terminates. This can be influenced by adjusting the limiter_node limit (7 in the example).

I have traced the problem back to the include file tbb/flow_graph.h: I can use both versions of the TBB DLL, but only the 20120718 version of tbb/flow_graph.h will produce the desired result.

For me, this is a showstopper. I have no idea how to work around this. Hope I've provided enough info! Thanks for any help or input on this - maybe I've just misunderstood the whole concept of a limiter_node :-)

Michael

0 Kudos
40 Replies
RafSchietekat
Valued Contributor III
606 Views
I'll be looking forward to your solution on Monday, then... :-)
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
Update... I downloaded sources for TBB 4.1 Update 1 and after a set of simple tests I couldn't reproduce the problem described by Michael with TBB 4.1 Update 1 on a computer with a Windows XP SP3 ( 32-bit ). Here is a complete version information of the 'tbb_debug.dll' dynamic library I used for verification: [ TBB 4.1 Update 1 ] TBB: VERSION 4.1 TBB: INTERFACE VERSION 6101 TBB: BUILD_DATE Wed, 3 Oct 2012 13:45:05 UTC TBB: BUILD_HOST FXEOWIN16 TBB: BUILD_OS Microsoft Windows [Version 5.2.3790] TBB: BUILD_CL Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 TBB: BUILD_COMPILER Intel(R) C++ Compiler XE for applications running on IA-32, Version 12.1.6.369 Build 20120821 TBB: BUILD_TARGET ia32 TBB: BUILD_COMMAND icl /nologo /Qvc10 /MDd /Od /Ob0 /Zi /EHsc /GR /Zc:forScope /Zc:wchar_t /DTBB_USE_DEBUG /D__TBB_LIB_NAME=tbb_debug.lib /GS /DDO_ITT_NOTIFY /DUSE_WINTHREAD /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0501 /Qstd=c++0x /D_TBB_CPP0X /D__TBB_BUILD=1 /W3 /WX TBB: TBB_USE_DEBUG 1 Verified cases are as follows ( for numbers ): 14, 28, 56, 112, 224, 448 and 896 ( ALL tests completed without any problems ). Also, I did additional verification with TBB 4.0 Update 3. [ TBB 4.0 Update 3 ] TBB: VERSION 4.0 TBB: INTERFACE VERSION 6003 TBB: BUILD_DATE Unknown EmptyTBB: TBB_USE_DEBUG undefined TBB: TBB_USE_ASSERT undefined TBB: DO_ITT_NOTIFY 1 Verified cases are as follows ( for numbers ): 14, 28, 56, 112, 224, 448 and 896 ( ALL tests completed without any problems ). Do you want me to submit all outputs as a proof that everything worked?
0 Kudos
Michael_K_4
Beginner
606 Views
Did you re-compile the test case using the corresponding TBB header files? Just exchanging tbb_debug.dll doesn't trigger the bug.
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
>>...Did you re-compile the test case using the corresponding TBB header files? Just exchanging tbb_debug.dll doesn't trigger the bug. I will do additional verification ( unfortunately not today... ). Thanks for the note.
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
>>...I use Visual Studio 2012 to compile... What edition of Visual Studio do you use? [ To TBB developers ] Are there any updates regarding the problem?
0 Kudos
Michael_K_4
Beginner
606 Views
> What edition of Visual Studio do you use? Visual Studio Professional 2012, Version 11.0.51106.01 Update 1 Visual C++ 2012
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
[ A statement from Raf ] >>...I had already tried to pinpoint the problem, myself, but, because of the substantial changes (not mentioned in CHANGES!), I almost >>immediately concluded (not unlike Michael) that I would prefer to first have Intel's TBB team have another look, instead. Michael, I put on hold any attempts to understand what is wrong until we hear anything from Intel TBB team. I downloaded TBB sources v4.1 Update 1 and I had too many liitle issues / problems from the beginning. Unfortunately, I can not commit more time on fixing some linker related errors, etc. not related to programming, and I support Raf's point of view. Note: I use TBB v4.0 Update 3 for a long time and I see that a decision to use that version is right. Take a look at my thread related to unresolved externals in TBB v4.1 Update 1 when sources are built with VS 2008 Express Edition. Even if I have VS 2008 Professional Edition I don't have time any more.
0 Kudos
Michael_K_4
Beginner
606 Views
Dear all, is there any news regarding this issue? BTW, I am not sure about the status of this forum - is this part of the open-source TBB community, or is it the official channel through which to report TBB bugs to Intel? Also, I was wondering is there any source repository for TBB where I can track who made what changes to the open-source version?
0 Kudos
RafSchietekat
Valued Contributor III
606 Views
I have no idea why the TBB team haven't picked this up yet, as they are evidently following the forum. If you follow threadingbuildingblocks.org's Site Map (link at the bottom of the home page) through "Contribute"/"Contact Us", you will find the text "Please use the Intel TBB forum to discuss issues, for technical support, or to report bugs." and a few recommendations on how to report a bug. There does not seem to be a publically accessible source repository, but you can download several recent versions.
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
>>...BTW, I am not sure about the status of this forum - is this part of the open-source TBB community, or is it the official channel >>through which to report TBB bugs to Intel? Yes, and you see how it works, unfortunately. Also, you could compare a quality of support ( that is a number of posts ) on Intel TBB forum with Intel Fortran forum. Take a look, please ( just for 30 seconds... ).
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
>>In the transition from TBB "4.1" to "4.1 Update 1" something seems to have gone wrong... Hi Michael, As you can see there are No any responses from Intel TBB team. I could suggest you to "rollback" version of TBB and use the working one, that is TBB v4.1 or TBB v4.0 Update 3. Best regards, Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
One more time... [ To TBB developers ] Are there any updates regarding the problem?
0 Kudos
Abhishek81
Novice
606 Views
@ Sergev I have downloaded Intel Parallel Studio XE 2013 ,Is TBB avaialble as default with it? how can I access the TBB from Intel Parallel Studio?
0 Kudos
SergeyKostrov
Valued Contributor II
606 Views
>>...I have downloaded Intel Parallel Studio XE 2013 ,Is TBB avaialble as default with it?... It has to be included and please take a look at: http://software.intel.com/en-us/intel-xe-product-comparison for more details.
0 Kudos
Christophe_H_Intel
606 Views

Hello, Michael,

Thank you very much for the report, and especially for the test case.  The transition to scheduler bypass for flow::graph occurred between 4.1 and 4.1 update 1.  There was a bug in the conversion of the code in continue_receiver.  The fix is to apply the following patch to include/tbb/flow_graph.h:

Index: flow_graph.h
===================================================================
--- flow_graph.h        (revision 9803)
+++ flow_graph.h        (working copy)
@@ -234,6 +234,7 @@
                 my_current_count = 0;
         }
         task * res = execute();
+        if(!res) return SUCCESSFULLY_ENQUEUED;
         return res;
     }
 

I have attached the patch file to this message.  (The ".h" at the end was to make it an allowable file type to upload.)

Again, thank you for the report.  I am very happy that people are using the code.

Regards,

Chris Huson

0 Kudos
Michael_K_4
Beginner
606 Views

Hello Chris,

thanks a lot for the patch. Now the flow graph works flawlessly again!

Michael

0 Kudos
Vladimir_P_1234567890
606 Views

hello,

the fix is also available in the 4.1 update 2

--Vladimir

0 Kudos
Michael_K_4
Beginner
606 Views

Hi Vladimir,

no, I just looked. The patch posted by Christopher Huson has not made it into tbb41_20130116_oss_src.tgz :-( Sorry...

- Michael

0 Kudos
Vladimir_P_1234567890
606 Views

oops sorry, my mistake. the build was done on 01/16 but the fix dated 01/18.

0 Kudos
Michael_K_4
Beginner
598 Views

I see the fix has made it into V.1 Update 3 (tbb41_20130314) - thanks!

0 Kudos
Reply