That makes sense given what I'm seeing since OMP_NUM_THREADS and other environmental variables work. I guess this isn't the issue then (still don't know why the Phi won't read the environmental variable, instead I have to pass it... but that's a whole separate issue). Thanks
On Thursday, March 3, 2016 at 10:54:48 AM UTC-8, Yichao Yu wrote: > > On Thu, Mar 3, 2016 at 1:36 PM, Chris Rackauckas <[email protected] > <javascript:>> wrote: > > Oh, meant the line with the mic environment variable: > > > > printf("%s\n",getenv("MIC_OMP_NUM_THREADS")); > > > > It's clear from context though. Sorry for the mistake. > > Env's are strings and you can't store a number in it. Especially not > by letting `printf` interpret a char* as a number. > > > > > > > On Thursday, March 3, 2016 at 10:35:42 AM UTC-8, Chris Rackauckas wrote: > >> > >> Hey, > >> I found a solution for strings here, but I really need it to be a > >> number. If I do > >> > >> ENV["MIC_OMP_NUM_THREADS"]=240 > >> > >> Then call a C function, I get > >> > >> printf("%s\n",getenv("OMP_NUM_THREADS")); > >> > >> as 240 whereas > >> > >> printf("%d\n",getenv("OMP_NUM_THREADS")); > >> > >> is garbage. Anyone know how to set it as an integer? Thanks. (P.S. > Yes, > >> this is Julia interfacing with a Xeon Phi. More on this soon!) >
