Software Archive
Read-only legacy content

Executable launched using micnativeloadex does not seem to detect environment variables

Michael_C_13
Beginner
235 Views

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
235 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"

0 Kudos
Michael_C_13
Beginner
235 Views

That works, thanks!

0 Kudos
Reply