Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_C_13
Beginner
44 Views

Executable launched using micnativeloadex does not seem to detect environment variables

Hello Intel Team,

I wrote a simple "hello world" application to familiarize myself with the Phi.  All it does is spit out omp_get_num_threads() inside and outside of an openmp parallel region.  I am attempting to control the number and placement of threads as described here:  https://software.intel.com/en-us/articles/openmp-thread-affinity-control.  For example, I tried

export MIC_ENV_PREFIX=PHI
export PHI_KMP_AFFINITY=scatter,verbose
export PHI_OMP_NUM_THREADS=60 (or 120, 180, etc)

However, when i run my application using

 micnativeloadex ./representative.x

, the usual "verbose" output does not appear, and the calls to omp_get_num_threads() inevitably return either 1 outside of an OpenMP parallel region or 236 within a parallel region. 

My assumption is that I have misunderstood something about how to pass environment variables to the coprocessor.  Any ideas?

Much appreciated, Michael

0 Kudos
2 Replies
Loc_N_Intel
Employee
44 Views

Hi Michael,

With micnativeloadex, you can pass the environment variables to the remote application with the switch -e. For example, if you want your remote OMP application running with 32 OMP threads:

$ micnativeloadex  app.mic -e "OMP_NUM_THREADS=32"

where app.mic is the MIC native application. For more information on usage, type "micnativeloadex -h"

Michael_C_13
Beginner
44 Views

That works, thanks!

Reply