We had the same kind of issue with all the multi threaded tests in validation 
and performance.
As I said to solve this, odp_cpu_count() actually returns the real cpu count - 
1.

I don't mind fixing the tests instead but in this case, I think all the 
multithreaded tests should be fixed too .

Nicolas

On 06/29/2015 07:16 PM, Maxim Uvarov wrote:
> On 06/29/15 19:32, Nicolas Morey-Chaisemartin wrote:
>> I'm fine with this but why should it only be for this test and not all of 
>> them?
> Do you have that problem in others tests? Which one?
>
> Maxim.
>
>> On 06/29/2015 06:09 PM, Maxim Uvarov wrote:
>>> Use first cpu as control thread to run workers. And
>>> all other cpus for workers run with pthread_create.
>>> If needed to run something on current core it has to be
>>> run directly, not with pthread_create.
>>>
>>> Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
>>> ---
>>>   test/validation/odp_scheduler.c | 4 +++-
>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/test/validation/odp_scheduler.c 
>>> b/test/validation/odp_scheduler.c
>>> index c2eb996..fc96d90 100644
>>> --- a/test/validation/odp_scheduler.c
>>> +++ b/test/validation/odp_scheduler.c
>>> @@ -683,7 +683,9 @@ static int schd_suite_init(void)
>>>         memset(globals, 0, sizeof(test_globals_t));
>>>   -    globals->cpu_count = odp_cpu_count();
>>> +    /* Use current cpu as control thread and run workers
>>> +     * on all others cpu.*/
>>> +    globals->cpu_count = odp_cpu_count() - 1;
>>>       if (globals->cpu_count > MAX_WORKERS)
>>>           globals->cpu_count = MAX_WORKERS;
>>>   
>

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to