Thread Settings for Maximum Parallelism (TSM)

Depending on the number of sites a test program tests, the number of pins in the pin map, the number of independent instrument resources on the tester, and the number of logical processors on the tester, you might need to adjust several thread-related settings to achieve greater execution parallelism and better performance. Because using the suggested setting values does not guarantee optimal performance, measure test program performance each time you change these settings to determine how the change affects performance.

LabVIEW Parallel For Loops

LabVIEW creates multiple instances of the contents of parallel For Loops and executes them in parallel. The number of instances that execute in parallel is determined by the value wired to the P terminal and the value of the Number of generated parallel loop instances option in the For Loop Iteration Parallelism dialog box in LabVIEW. By default, LabVIEW uses the minimum of the number of logical processors on the tester and the number of logical processors on the computer used to save the VI. To ensure maximum parallelism, use the following parallel For Loop settings:

  • Number of generated parallel loop instances—The best value for this setting depends on the purpose of the loop. Do not use an arbitrarily large number for this setting because it can add to execution time and can cause high memory usage and long delays when unloading the test program.
    • For the For Loops that iterate over instrument sessions, set the Number of generated parallel loop instances option to the maximum number of instrument sessions the loop can use. The maximum number of instrument sessions used depends on the type of instrument, the number of pins, and the number of sites and settings on the Options tab of the Semiconductor Multi Test or Semiconductor Action step. For channel-based sessions, such as NI-DCPower sessions, use the following equation to determine the maximum number of sessions the loop can use: (number of pins used by loop)*(maximum number of sites in a single block in the Multisite Execution Diagram on Options tab) For NI-Digital Pattern instruments and other instrument-based sessions, use the number of instruments of that type in the pin map.
    • For the For Loops that process data, you often can achieve the best performance by disabling loop parallelism. If the data processing is relatively slow and CPU intensive (such as the computation of large FFTs), first set the Number of generated parallel loop instances option to the number of logical processors on the target tester. If the loop has more iterations than the number of logical processors, try larger values for the Number of generated parallel loop instances option and measure performance to determine the best value to use.
  • P terminal—Wire the P terminal to the size of the array that the For Loop uses for indexing. Leaving the P terminal unconnected causes LabVIEW to use the lesser of the Number of generated parallel loop instances option and the number of logical processors on the tester.

LabVIEW Adapter Settings

For VIs that TestStand steps call using the LabVIEW Run-Time Engine, the LabVIEW Adapter allocates threads to execute the VIs that use the same as caller execution system. Change the Number of Threads option on the LabVIEW Adapter Configuration dialog box to the maximum number of parallel loop instances that all VIs in the test program require.

Note In TestStand 2016 and earlier, you can use the LabVIEW Adapter Configuration dialog box to set the number of LabVIEW execution threads to a maximum value of 2 x the number of logical processors. If you need more threads than that for all VIs running in parallel, configure the VIs to use an execution system other than the same as caller execution system on the Execution page of the VI Properties dialog box in LabVIEW and configure the number of execution threads assigned to a LabVIEW execution system. The following versions of TestStand prevent you from setting the Number of Threads option in the LabVIEW Adapter Configuration dialog box greater than a maximum value:
VersionMaximum Value
TestStand 2016 and earlier12
TestStand 201736
TestStand 2017 SP1 and later96
If you need more threads than the maximum number permitted, you must edit the <TestStand Application Data>\Cfg\Adapters.cfg file and change the value of the _FlexGAdp_NumofThreadsUsedinRTE setting. A limitation in LabVIEW 2018 SP1 and earlier might prevent you from setting a large number of threads.