Please take a look at another very simple way to set some environment variable programmatically. That was discussed
about two days ago. A link to a thread is:
and a Post #2 has an example.
What I can see that the 'KMP_AFFINITY problem' is hot and many developersare havingproblems.