schrodinger.seam.testing.stu_tests.thread_limiting module¶
Test that SDK workers limit thread counts for numerical libraries by default.
Verifies that OMP_NUM_THREADS, MKL_NUM_THREADS, OPENBLAS_NUM_THREADS, and NUMEXPR_MAX_THREADS are set to 1 inside worker processes, and that setting SCHRODINGER_SEAM_ALLOW_MULTITHREAD opts out.
Usage:
$SCHRODINGER/run python3 -m schrodinger.seam.testing.stu_tests.thread_limiting
- class schrodinger.seam.testing.stu_tests.thread_limiting.CaptureThreadEnv(*unused_args, **unused_kwargs)¶
Bases:
DoFnCapture thread-limiting env vars from inside the worker process.
- process(element)¶
Method to use for processing elements.
This is invoked by
DoFnRunnerfor each element of a inputPCollection.The following parameters can be used as default values on
processarguments to indicate that a DoFn accepts the corresponding parameters. For example, a DoFn might accept the element and its timestamp with the following signature:def process(element=DoFn.ElementParam, timestamp=DoFn.TimestampParam): ...
The full set of parameters is:
DoFn.ElementParam: element to be processed, should not be mutated.DoFn.SideInputParam: a side input that may be used when processing.DoFn.TimestampParam: timestamp of the input element.DoFn.WindowParam:Windowthe input element belongs to.DoFn.TimerParam: auserstate.RuntimeTimerobject defined by the spec of the parameter.DoFn.StateParam: auserstate.RuntimeStateobject defined by the spec of the parameter.DoFn.KeyParam: key associated with the element.DoFn.RestrictionParam: aniobase.RestrictionTrackerwill be provided here to allow treatment as a SplittableDoFn. The restriction tracker will be derived from the restriction provider in the parameter.DoFn.WatermarkEstimatorParam: a function that can be used to track output watermark of SplittableDoFnimplementations.DoFn.BundleContextParam: allows a shared context manager to be used per bundleDoFn.SetupContextParam: allows a shared context manager to be used per DoFn
- schrodinger.seam.testing.stu_tests.thread_limiting.main()¶