On Thu, Mar 3, 2016 at 1:36 PM, Chris Rackauckas <[email protected]> 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!)

Reply via email to