Page 1 of 1

Different behaviour for Vector Select function when compiled

Posted: Tue Jan 07, 2020 1:09 am
by drw
Hi Folks,

Investigating compiled versus non-compiled for our rather large energy model, and was noticing some output differences between compiled versus non-compiled. I managed to track it back to some equations that were using the VECTOR SELECT function which was using double subscript variables. Essentially, in the compiled version it seems like only the second subscript variable was utilised in the function and the first subscript was ignored (the queried, not compiled module behaved as expected). This was using 64 bit DSS v8.06 on Windows 10.

So for example say the first subscript has an array of 3 elements [1,2,4] and the second subscript has weightings (let's make them all 1 for convenience e.g. [1,1,1]). Then a vector select function using the sum action would return 7 (1*1 + 2*1 + 4*1) in the non compiled version as expected. In the compiled version it would return 3 (1 + 1 + 1) and ignore the first set of subscript values.

I have included a sample model with results and dll which illustrate the issue. Wondering if this is a known bug? (Note, I haven't tested it on the 32-bit version of Vensim).

Thanks,
Dave

Re: Different behaviour for Vector Select function when compiled

Posted: Tue Jan 07, 2020 10:04 am
by Administrator
Thanks for this report. This bug has been present in Vensim for a long time.

I'll get back to you as soon as I have a solution.