GitHub issue: [WARNING] Thread count
State: closed

```
[WARNING] We've detected that your software may be threading or using other multiprocessing
techniques during template creation.  The number of threads detected was ... and it should be 2.
Per the API document, implementations must run single-threaded.  In the test environment, there
is no advantage to threading, because NIST will distribute workload across multiple blades and
multiple processes.  We highly recommend that you fix this issue prior to submission.
```

I currently get this warning because my application seems to spawn extra threads. If I use  `ps aux | grep validate11` instead of `top -H -b -n1 | grep validate11`, I get only 2 active processes.

From the documentation it is not completely clear if this is an actual problem and must be fixed before submitting or it simply states that it won't give me any advantage during the real test procedure (therefore it's not mandatory to get fixed).

Any extra clarification would be very appreciated.

They are using “soft” words, but you have to fix.

Em qua, 12 de jun de 2019 às 05:31, Riccardo Gallina <
notifications@github.com> escreveu:

> [WARNING] We've detected that your software may be threading or using other multiprocessing
> techniques during template creation.  The number of threads detected was ... and it should be 2.
> Per the API document, implementations must run single-threaded.  In the test environment, there
> is no advantage to threading, because NIST will distribute workload across multiple blades and
> multiple processes.  We highly recommend that you fix this issue prior to submission.
>
> I currently get this warning because my application seems to spawn extra
> threads. If I use ps aux | grep validate11 instead of top -H -b -n1 |
> grep validate11, I get only 2 active processes.
>
> From the documentation it is not completely clear if this is an actual
> problem and must be fixed before submitting or it simply states that it
> won't give me any advantage during the real test procedure (therefore it's
> not mandatory to get fixed).
>
> Any extra clarification would be very appreciated.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/usnistgov/frvt/issues/12?email_source=notifications&email_token=AC4DLD7DD33THK7J4FRRDWDP2CX4ZA5CNFSM4HXGR5GKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GY76TUA>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AC4DLD6CAEB5UR6SIGEIIXDP2CX4ZANCNFSM4HXGR5GA>
> .
>
-- 
Sent from Gmail Mobile for iPhone


@gasgallo the "top -H" command that we're using counts individual threads being used by the program, where as your "ps" command is counting processes.  

We distribute workload across multiple processes (and multiple blades).  The intent of not allowing threading is to prevent unnecessary thrashing.  More importantly, we measure timing and to accomplish a fair timing benchmark, we don't allow threading with the intent to speed up processing.  Please note that during timing, we lock all threads to using a single CPU, so if your submission ends up taking more than 1 second to generate a single template on a single CPU core, your algorithm will not be accepted for testing.

With that said, we've encountered instances where developers have used third party libraries (such as Tensorflow) that spawn one or two idle threads that don't actually do anything.  We will assess those on a case by case basis, but we highly recommend that you make every effort to not thread in your software.

Hi, same warning here, 
When I use `top -H -b -n1 | grep validate11`  it shows max upto 6 processes, but only one of them is running at a time, rest are sleeping 

Output of above command returns (Only one thread is running(R) at a time)
16459 centos    20   0  579936 313696    5972 R 99.9  2.1   7:44.46 validate11
16461 centos    20   0  579936 313696    5972 S  6.7  2.1   2:20.65 validate11
16030 centos    20   0  280684 129720  25536 S  0.0  0.9   0:52.19 validate11
16460 centos    20   0  579936 313696    5972 S  0.0  2.1   0:00.00 validate11

@mlngan I tried a lot to control threads in tensorflow, but could not get lower than 6 threads, Can it be accepted ?

We have received submissions that have been able to get the Tensorflow threads down to one or two, so please look again.

@Nawal-Singh-666 Did you find the solution controlling threads in tensorflow? 

In TensorFlow, you can restrict the number of threads to 1 by setting the value of num_threads to 1 in the following two functions
tf.config.threading.set_inter_op_parallelism_threads(
    num_threads
)
tf.config.threading.set_intra_op_parallelism_threads(
    num_threads
)

inter and intra _op_parallelism_threads set the number of threads to N, where N is the number of cores.

I also got this warning even though i already set thread count to 1. However, the frameworks (MNN and TVM) i'm using still spawn 12 threads but only 1 is active. In this case, is it ok to submit like this?