After restart julia :

D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 0.3.0-prerelease 
ver 3>bin\julia.exe -p 8
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+2599 (2014-04-11 23:52 
UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit bf7096c (50 days old master)
|__/                   |  x86_64-w64-mingw32

julia> const k=200000000
200000000

julia> tic();

julia> nheads = @parallel (+) for i=1:k
       int(randbool())
       end
exception on exception on 3: 4: ERROR: ERROR: exception on exception on 2: 
exception on 7: ERROR: 5:
 ERROR: ERROR: exception on k not defined6: exception on ERROR:
 in anonymous at no file:1379
8k:  not definedERROR:
 in anonymous at no file:1379
k not definedk not defined
 in anonymous at no file:1379

 in anonymous at no file:1379
k not definedk not definedk not defined
 in anonymous at no file:1379

 in anonymous at no file:1379

 in anonymous at no file:1379exception on
9: ERROR: k not defined
 in anonymous at no file:1379
ERROR: no method +(UndefVarError, UndefVarError)
 in mr_pairwise at reduce.jl:534

julia> toc()
elapsed time: 2.493525081 seconds
2.493525081

julia>

W dniu niedziela, 1 czerwca 2014 16:27:14 UTC+2 użytkownik paul analyst 
napisał:
>
>
>
>
>
> *julia> const k=200000000;ERROR: cannot declare k constant; it already has 
> a value:/Paul*
> W dniu niedziela, 1 czerwca 2014 16:13:27 UTC+2 użytkownik Andreas Noack 
> Jensen napisał:
>>
>> This is the usual problem with global variables in Julia. If you define k 
>> by 
>>
>> const k=200000000
>>
>> the timing results should be similar.
>>
>>
>> 2014-06-01 16:09 GMT+02:00 paul analyst <[email protected]>:
>>
>>>
>>> D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 
>>> 0.3.0-prerelease ver 3>bin\julia.exe -p 8
>>>                _
>>>    _       _ _(_)_     |  A fresh approach to technical computing
>>>   (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
>>>    _ _   _| |_  __ _   |  Type "help()" to list help topics
>>>   | | | | | | |/ _` |  |
>>>   | | |_| | | | (_| |  |  Version 0.3.0-prerelease+2599 (2014-04-11 
>>> 23:52 UTC)
>>>  _/ |\__'_|_|_|\__'_|  |  Commit bf7096c (50 days old master)
>>> |__/                   |  x86_64-w64-mingw32
>>>
>>> julia> procs()
>>> 9-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>  4
>>>  5
>>>  6
>>>  7
>>>  8
>>>  9
>>>
>>> julia> tic();
>>>
>>> julia> nheads = @parallel (+) for i=1:200000000
>>>        int(randbool())
>>>        end
>>> 100006468
>>>
>>> julia> toc()
>>> elapsed time: 2.77418807 seconds
>>> 2.77418807
>>>
>>> julia>exit()
>>>
>>>
>>> D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 
>>> 0.3.0-prerelease ver 3>bin\julia.exe -p 8
>>>                _
>>>    _       _ _(_)_     |  A fresh approach to technical computing
>>>   (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
>>>    _ _   _| |_  __ _   |  Type "help()" to list help topics
>>>   | | | | | | |/ _` |  |
>>>   | | |_| | | | (_| |  |  Version 0.3.0-prerelease+2599 (2014-04-11 
>>> 23:52 UTC)
>>>  _/ |\__'_|_|_|\__'_|  |  Commit bf7096c (50 days old master)
>>> |__/                   |  x86_64-w64-mingw32
>>>
>>> julia> k=200000000
>>> 200000000
>>>
>>> julia> tic();
>>>
>>> julia> nheads = @parallel (+) for i=1:k
>>>        int(randbool())
>>>        end
>>> 99989022
>>>
>>> julia> toc()
>>> elapsed time: 18.631674663 seconds
>>> 18.631674663
>>>
>>> julia>
>>>
>>> What hapend ?
>>>
>>> Paul
>>>
>>>
>>>
>>
>>
>> -- 
>> Med venlig hilsen
>>
>> Andreas Noack Jensen
>>  
>

Reply via email to