On Sat, 28 Jan 2017, Marcin Błażejowski wrote:
Or can I do something like "eval set omp_num_threads" [of
course not in
the current sence of eval] to get string "omp_num_threads: positive
integer, currently 4" which I could parse next?
This is a bit baroque, but seems to work:
<hansl>
set echo off
set messages off
function scalar ompthds(void)
scalar ret
outfile s --buffer --quiet
set omp_num_threads
outfile --close
l = strlen(s)
c = ""
loop while c != " " --quiet
c = substr(s, l, l)
l--
endloop
sscanf(s+l, " %d", ret)
return ret
end function
n = ompthds()
printf "As of now, %d\n", n
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------