On Sat, 28 Jan 2017, Riccardo (Jack) Lucchetti wrote:
On Sat, 28 Jan 2017, Sven Schreiber wrote:
> Am 28.01.2017 um 19:29 schrieb Riccardo (Jack) Lucchetti:
>> On Sat, 28 Jan 2017, Allin Cottrell wrote:
>
>>>
>>> Slightly less baroque:
>>>
>>> <hansl>
>>> function scalar ompthds(void)
>>> scalar ret
>>> outfile s --buffer --quiet
>>> set omp_num_threads
>>> outfile --close
>>> sscanf(strstr(s, ",") + 1, "%*s %d", ret)
>>> return ret
>>> end function
>>> </hansl>
>>
>> Well, I had thought of something like that too, but couldn't be bothered
>> to check all the po files if that would be robust to translations, so I
>> just assumed the number would come last.
>>
>
> Why not have a $set accessor bundle with all the current settings?
Yes, that would be the "right" way. In fact we could revitalise the $sysinfo
bundle to that purpose. Now that I check, there is a much saner way to do
what Marcin needs:
<hansl>
scalar n = $sysinfo.omp_num_threads
</hansl>
Urgh, I'd forgotten about that! Recall also:
print $sysinfo
for a look at what's available.
(I'd say if we reckon a "set" bundle is a worthwhile thing to have
it should be separate from $sysinfo, which is quite focused as it
stands.)
Allin