[scilab-Users] generators for grand
Daniele Andreucci
andreucci at dmmm.uniroma1.it
Sun Dec 5 21:07:52 CET 2010
michael.baudin at scilab.org wrote on 12/05/10 11:29:
>
> Hi,
>
> Your report is that, on your machine:
> * mt, urand, kiss : work
> * fsultra, clcg2, clcg4 : fail
> It may happen that there is a bad portability of the source code of
> these generators on 64 bits systems.
>
Actually,
* mt, clcg2, clcg4: work
* fsultra, kiss, urand: fail
as confirmed by running your script:
>
> for rngen = [ "mt", "kiss", "clcg2", "clcg4", "urand", "fsultra" ]
> mprintf("rngen:%s\n",rngen);
> grand ( "setgen" , rngen );
> r = grand(1,1,"exp",1);
> m = grand(1,"mul",10,[0.2;0.5]);
> end
>
I ran it by removing the three generators "kiss", "urand", "fsultra"
from the list rngen, and everything worked. If I add one of the three to
the list, Scilab gets stuck: I mean, when the cycle arrives at the
failing generator, it outputs the generator name, and then the
computation never ends, the Scilab window menu commands (like Quit) do
not work, and I need stop the process by means of the Linux kill command.
The instruction actually causing the freeze seems to be the one calling
the "mul" distribution. Indeed, the instruction
> r = grand(1,1,"exp",1);
is carried out anyway, even with "kiss", "urand", "fsultra". But its
results are suspect (I think): the following is the output of a
modification of the script above, cycling 1000 times for each given
generator, and averaging the variable r:
*** Scilab script:
for rngen = [ "mt", "clcg2", "clcg4" , "kiss", "fsultra", "urand" ]
mprintf("rngen:%s\n",rngen);
grand ( "setgen" , rngen );
r=grand(1,1,"exp",1);
for i=1:999 do
r = grand(1,1,"exp",1) + r;
end
r=r/1000
// m = grand(1,"mul",10,[0.2;0.5])
end
***
*** Scilab output:
-->exec("test2.sci");
rngen:mt
r =
0.9827961
rngen:clcg2
r =
1.0035369
rngen:clcg4
r =
1.0353063
rngen:kiss
r =
30419447.
rngen:fsultra
r =
31473190.
rngen:urand
r =
63800551.
***
Moreover, about the other hint:
> Does the following work (after a restart of Scilab):
>
> grand ( "setgen" , "fsultra" );
> m = grand(1,"mul",10,[0.2;0.5]);
it does not work, Scilab freezes as explained above.
I performed the trials with Scilab 5.3 beta5 Linux 64 bit, but sporadic
attempts confirmed the same behaviour for Scilab 5.2.2 (standard Debian
Squeeze amd64 package).
Thanks a lot for your help, and for the pointers to the code.
Best regards
Daniele Andreucci
--
[ Daniele Andreucci
[ Dip. di Scienze di Base e Applicate per l'Ingegneria
[ via A. Scarpa 16 00161 Roma, Italy
[ tel. +39 0649766785
[ fax +39 064957647
[ e-mail: andreucci at dmmm.uniroma1.it
[ http://www.dmmm.uniroma1.it/~andreucci/
[ gpg pub key id: D3ADC732
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <https://lists.scilab.org/pipermail/users/attachments/20101205/8919c3ec/attachment.sig>
More information about the users
mailing list