I tried running some scripts that use @everywhere.
And I receive the following Alert:
LoadError: LoadError: UndefVarError: @everywhere not defined
in expression starting at D: \ Julia SoftWare \ Julia Scripts \ julia-and-julia-sets: 35
in expression starting at D: \ Julia SoftWare \ Julia Scripts \ julia-and-julia-sets: 35
top-level scope
When inquiring into the file exports.jl, of my Julia installation, this macro is not included!
Where do I look for or how to include this macro?
julia> @everywhere 1+1
WARNING: Base.@everywhere is deprecated: it has been moved to the standard library package `Distributed`.
Add `using Distributed` to your imports.
in module Main
julia> @parallel 1+1
┌ Warning: `@parallel` is deprecated, use `@distributed` instead.
│ caller = eval(::Module, ::Any) at boot.jl:319
└ @ Core ./boot.jl:319
@everywhere julia = julia
@everywhere julia_set = julia_set
# Re-write our code to generate the sets in parallel
nr_frames = 40
sets = @sync @parallel append! for n=0:nr_frames
c = e ^ (2*π*n/nr_frames*im)
set = julia_set(height, width, c)
[set]
end
anim = @animate for set in sets
heatmap(set, size=(width,height), color=:speed, leg=false)
end
file_name = "C:/Users/user/Pictures/julia_$(height)_$(width)_$(nr_frames).gif"
gif(anim, file_name, fps=4)
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: https://docs.julialang.org
_ _ | | __ _ | Type “?” for help, “]?” for Pkg help.
| | | | | | |/ ` | |
| | || | | | (| | | Version 0.7.0 (2018-08-08 06:46 UTC) / |_‘|||_’_| | Official http://julialang.org/ release
|__/ | x86_64-w64-mingw32
julia> @everywhere 1+1
WARNING: Base.@everywhere is deprecated: it has been moved to the standard library package Distributed.
Add using Distributed to your imports.
in module Main
WARNING: Base.@everywhere is deprecated: it has been moved to the standard library package Distributed.
Add using Distributed to your imports.
in module Main
julia>
julia> using Distributed
julia> @distributed 1+1
ERROR: LoadError: malformed @distributed loop
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] @distributed(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Distributed\src\macros.jl:329
in expression starting at REPL[7]:1
julia> @everywhere 1+1
WARNING: Base.@everywhere is deprecated: it has been moved to the standard library package Distributed.
Add using Distributed to your imports.
in module Main
WARNING: Base.@everywhere is deprecated: it has been moved to the standard library package Distributed.
Add using Distributed to your imports.
in module Main
#https://hackernoon.com/julia-and-julia-sets-e5a6fa3de7a7
function julia(x, y, width, height, c)
# Scale size the fractal within our frame
z = ((y/width)*2.7 - 1.3) + ((x/height)*4.5 - 2.5)im
for i = 1:255
z = z^2 + c
if abs(z) >= 4
return i
end
end
return -255
end
function julia_set(height, width, c)
[julia(x, y, width, height, c) for x = 1:height, y = 1:width]
end
# Install the packages we need
#Pkg.add("Plots")
#Pkg.add("GR")
# Import the Plots library in the current runtime
using Plots, Distributed
# Initialize the gr backend
gr()
# Set the size of our images
height = 800
width = 800
c = 1.2*exp(1.1π*im)
# Generate the set
data = julia_set(height, width, c)
# Generate the heatmap and save it as a PNG
file_name = "C:/Users/user/Pictures/julia_$(height)_$(width)_$(c.re)_$(c.im)"
png(heatmap(data, size=(width,height), color=:ice), file_name)
@everywhere julia = julia
@everywhere julia_set = julia_set
# Re-write our code to generate the sets in parallel
nr_frames = 40
sets = @sync @distributed append! for n=0:nr_frames
c = e ^ (2*π*n/nr_frames*im)
set = julia_set(height, width, c)
[set]
end
anim = @animate for set in sets
heatmap(set, size=(width,height), color=:speed, leg=false)
end
file_name = "C:/Users/user/Pictures/julia_$(height)_$(width)_$(nr_frames).gif"
gif(anim, file_name, fps=4)
Error evaluating julia-and-julia-sets.jl
LoadError: IOError: could not spawn ffmpeg -v 0 -i 'C:\Users\user\AppData\Local\Temp\jl_1409.tmp/%06d.png' -vf palettegen=stats_mode=diff -y 'C:\Users\user\AppData\Local\Temp\jl_1409.tmp/palette.bmp': no such file or directory (ENOENT)
in expression starting at D:\Julia SoftWare\Julia Scripts\julia-and-julia-sets.jl:52
_jl_spawn(::String, ::Array{String,1}, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:370
(::getfield(Base, Symbol(“##499#500”)){Cmd})(::Tuple{RawFD,RawFD,RawFD}) at process.jl:512
setup_stdio(::getfield(Base, Symbol(“##499#500”)){Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:493
#_spawn#498(::Nothing, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:511
_spawn at process.jl:507 [inlined]
run#509(::Bool, ::Function, ::Cmd) at process.jl:669
run at process.jl:668 [inlined]
#buildanimation#232(::Int64, ::Int64, ::Bool, ::Bool, ::Function, ::String, ::String, ::Bool) at animation.jl:82
#gif#229 at none:0 [inlined]
(::getfield(Plots, Symbol(“#kw##gif”)))(::NamedTuple{(:fps,),Tuple{Int64}}, ::typeof(gif), ::Animation, ::String) at none:0