{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/9476","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/9476/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/9476/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/9476/events","html_url":"https://github.com/JuliaLang/julia/issues/9476","id":52968945,"number":9476,"title":"Scripts runs interactively, but not from console","user":{"login":"bdeonovic","id":805168,"avatar_url":"https://avatars.githubusercontent.com/u/805168?v=3","gravatar_id":"","url":"https://api.github.com/users/bdeonovic","html_url":"https://github.com/bdeonovic","followers_url":"https://api.github.com/users/bdeonovic/followers","following_url":"https://api.github.com/users/bdeonovic/following{/other_user}","gists_url":"https://api.github.com/users/bdeonovic/gists{/gist_id}","starred_url":"https://api.github.com/users/bdeonovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdeonovic/subscriptions","organizations_url":"https://api.github.com/users/bdeonovic/orgs","repos_url":"https://api.github.com/users/bdeonovic/repos","events_url":"https://api.github.com/users/bdeonovic/events{/privacy}","received_events_url":"https://api.github.com/users/bdeonovic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/parallel","name":"parallel","color":"f7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-12-27T23:54:34Z","updated_at":"2015-01-05T04:19:29Z","closed_at":null,"body":"I am writing a script that I would like to run from the console like \r\n\r\n```bash\r\njulia -p 6 SLRA.jl input1 input2\r\n```\r\n\r\nnotice it makes use of multiple processors. When I run the script in this way I get:\r\n```julia\r\nexception on 2: ERROR: genes not defined\r\n in anonymous at no file:1432\r\n in anonymous at multi.jl:1279\r\n in anonymous at multi.jl:848\r\n in run_work_thunk at multi.jl:621\r\n in run_work_thunk at multi.jl:630\r\n in anonymous at task.jl:6\r\n```\r\non all of the processors (not just 2). I think the offending section in the code might be: \r\n\r\n```julia\r\n  result = Array(ASCIIString, length(keys(gene_dict)))\r\n  genes = collect(keys(gene_dict))\r\n\r\n  generefs  = [ @spawnat i genes for i in 1:nprocs()]\r\n  dict1refs = [ @spawnat i gene_dict for i in 1:nprocs()]\r\n  dict2refs = [ @spawnat i transcript_dict for i in 1:nprocs()]\r\n\r\n  result = @parallel (vcat) for i in 1:length(genes)\r\n    EM(fetch(genes[i]), fetch(gene_dict), fetch(transcript_dict))\r\n  end\r\n```\r\nwhere `EM` is a function that is defined on all processors earlier on. Now the funny thing is that when I run this script line by line in an interactive session (open julia terminal with `julia -p 6`) it works! What could be the issue? \r\n\r\nI have tried on:\r\n\r\n```julia\r\njulia> versioninfo()\r\nJulia Version 0.4.0-dev+2200\r\nCommit 79d473c (2014-12-18 17:30 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-linux-gnu)\r\n  CPU: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)\r\n  LAPACK: liblapack.so.3\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.3\r\n```\r\n\r\nand\r\n\r\n```julia\r\njulia> versioninfo()\r\nJulia Version 0.3.4\r\nCommit 3392026* (2014-12-26 10:42 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-redhat-linux)\r\n  CPU: Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)\r\n  LAPACK: libopenblas\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.3\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/68666885","html_url":"https://github.com/JuliaLang/julia/issues/9476#issuecomment-68666885","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/9476","id":68666885,"user":{"login":"amitmurthy","id":117461,"avatar_url":"https://avatars.githubusercontent.com/u/117461?v=3","gravatar_id":"","url":"https://api.github.com/users/amitmurthy","html_url":"https://github.com/amitmurthy","followers_url":"https://api.github.com/users/amitmurthy/followers","following_url":"https://api.github.com/users/amitmurthy/following{/other_user}","gists_url":"https://api.github.com/users/amitmurthy/gists{/gist_id}","starred_url":"https://api.github.com/users/amitmurthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitmurthy/subscriptions","organizations_url":"https://api.github.com/users/amitmurthy/orgs","repos_url":"https://api.github.com/users/amitmurthy/repos","events_url":"https://api.github.com/users/amitmurthy/events{/privacy}","received_events_url":"https://api.github.com/users/amitmurthy/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T04:19:29Z","updated_at":"2015-01-05T04:19:29Z","body":"Same here. `julia -p 4 MCF7.jl refFlat_small.gpd lr_x_hg19TransSmall.psl` works fine on my linux box. I did replace the filenames with ARGS[1] and ARGS[2]."}}