- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm in a bit of a tough spot and figured maybe the community would have some advice here. I am running a ray tracing code that uses concurrent_vectors to store data. The code works fine on my company's HPC, however when I am attempting to run on a customer's HPC I am getting the error below
"Exception caught:reservation size exceeds permitted max size”
We have determined that it is throwing this error when one of the array objects is attempting to resize.
The hardware on the two systems is very comparible, and I have tried to swap out libtbb.so.2 libraries with no luck.
My question is: where is tbb coming up with the max_size value? Is there an environment or setting that could be limiting that value?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
Could you please provide us a sample reproducer(steps to be followed to reproduce the issue) so that we can try it from our end.
>>The hardware on the two systems is very comparible
Could you provide the hardware details of both systems. Also provide OS details & version of Compilers being used.
Thanks & Regards
Noorjahan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please provide the above-requested details? so that it will help us to investigate more on your issue.
Thanks & Regards
Noorjahan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question
Thanks & Regards
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
It looks like you are trying to reserve the size of concurrent_vector greater than can be allocated (available) on one of the systems (you use). In TBB, tbb_misc.cpp contains the exception (definition) of what you see,
case eid_reservation_length_error: DO_THROW(std::length_error, ("reservation size exceeds permitted max size") );
which is called from concurrent_vector.cpp
void concurrent_vector_base_v3::internal_reserve( size_type n, size_type element_size, size_type max_size ) {
if( n>max_size )
throw_exception(eid_reservation_length_error);
And internal_reserve() method is called in reserve() method which is defined in concurrent_vector.h:
//! Allocate enough space to grow to size n without having to allocate more memory later.
/** Like most of the methods provided for STL compatibility, this method is *not* thread safe.
The capacity afterwards may be bigger than the requested reservation. */
void reserve( size_type n ) {
if( n )
internal_reserve(n, sizeof(T), max_size());
}
and so finally max_size() is defined in the same file concurrent_vector.h
//! Upper bound on argument to reserve.
942 size_type max_size() const {return (~size_type(0))/sizeof(T);}
~(size_t)0 is guaranteed to be the maximum size_t value. For example, see discussion at
"
Why is ~(size_t)0 guaranteed to be the maximum? Because the standard explicitly says so: from §6.5.3.3: "If the promoted type is an unsigned type, the expression ~E is equivalent to the maximum value representable in that type minus E."
"
You can try to print ~size_type(0))/sizeof(T) on both systems in question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I talked to engineering team and they pointed to me that it seems that you use the "old" TBB version: TBB 2020 or earlier.
Starting from oneTBB 2021, the implementation of concurrent_vector was redesigned and one of the significant changes is improved support for user-provided allocators. The implementation of concurrent_vector::max_size was also affected: now it returns the maximum number of elements which can be allocated with the allocator, provided by the user (specifically ``std::allocator_traits<Allocator>::max_size(alloc_obj).
It seems that the question you are asking is not applicable to oneTBB 2021 and currently we are not planning to backport the changes described above into the older TBB versions. Just one more reason to switch to new oneTBB version if you can.
Also, please indicate if you are still interested in this issue. With no response from you, the support will be limited to community support.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page