Julia SLURM script erropr - julia

I have installed Julia on a remote High Performance Computing centre and am in the process of calling .jl-files via SLURM batch script. However, it seems like the "Pkg" command is not available because the following message pops up:
ERROR: LoadError: UndefVarError: Pkg not defined
Stacktrace:
[1] top-level scope at /users/pa19/lanast/taskp/LAfem.jl:1
[2] include at ./boot.jl:328 [inlined]
[3] include_relative(::Module, ::String) at ./loading.jl:1105
[4] include(::Module, ::String) at ./Base.jl:31
[5] exec_options(::Base.JLOptions) at ./client.jl:287
[6] _start() at ./client.jl:460
in expression starting at /users/pa19/lanast/taskp/LAfem.jl:1
Could it be an issue with the installation of Julia? Does one have to provide the exact links for Julia to know where to fetch them from?
Thanks
Lysandros

Thank you fredrikekre and Przemyslaw. If instead I write the two lines
using Pkg
Pkg.installed()
then the following appears:
ERROR: LoadError: IOError: stat: permission denied (EACCES) for file "/users/apps/compilers/julia/1.3.1/share/julia/stdlib/v1.3/Pkg/src/Pkg.jl"
Stacktrace:
[1] stat(::String) at ./stat.jl:69
[2] isfile at ./stat.jl:311 [inlined]
[3] isfile_casesensitive at ./loading.jl:9 [inlined]
[4] entry_point_and_project_file_inside at ./loading.jl:438 [inlined]
[5] entry_point_and_project_file(::String, ::String) at ./loading.jl:453
[6] implicit_project_deps_get at ./loading.jl:605 [inlined]
[7] project_deps_get(::String, ::String) at ./loading.jl:308
[8] identify_package(::String) at ./loading.jl:220
[9] identify_package(::Base.PkgId, ::String) at ./loading.jl:206
[10] identify_package at ./loading.jl:200 [inlined]
[11] require(::Module, ::Symbol) at ./loading.jl:882
[12] include at ./boot.jl:328 [inlined]
[13] include_relative(::Module, ::String) at ./loading.jl:1105
[14] include(::Module, ::String) at ./Base.jl:31
[15] exec_options(::Base.JLOptions) at ./client.jl:287
[16] _start() at ./client.jl:460
in expression starting at /users/pa19/lanast/taskp/LAfem.jl:1
In order to build julia I use the script:
## LOAD MODULES ##
module purge # clean up loaded modules
# load necessary modules
module load intel/18.0.5
module load gnu/4.9.2
module load java/9.0
module load julia
## RUN CODE ##
date
julia LAfem.jl
date
I will check whether the master node has different hardware than the worker node. But generally, only one node is used for this job. Kind regards

Related

How to use Gurobi?

I want to use Gurobi in a program like so:
use Gurobi
To which get the following error message:
ERROR: LoadError: Gurobi not properly installed. Please run Pkg.build("Gurobi"). For
more information go to https://github.com/jump-dev/Gurobi.jl
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] top-level scope at /Users/prikshetsharma/.julia/packages/Gurobi/P6eVP/src/Gurobi.jl:7
[3] include(::Function, ::Module, ::String) at ./Base.jl:380
[4] include(::Module, ::String) at ./Base.jl:368
[5] top-level scope at none:2
[6] eval at ./boot.jl:331 [inlined]
[7] eval(::Expr) at ./client.jl:467
[8] top-level scope at ./none:3
in expression starting at /Users/prikshetsharma/.julia/packages/Gurobi/P6eVP/src/Gurobi.jl:4
ERROR: LoadError: Failed to precompile Gurobi [2e9cd046-0924-5485-92f1-d5272153d98b] to /Users/prikshetsharma/.julia/compiled/v1.5/Gurobi/do9v6_rMyJO.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] exec_options(::Base.JLOptions) at ./client.jl:296
[9] _start() at ./client.jl:506
in expression starting at /Users/prikshetsharma/Documents/clotorch/src/clotorch/flight/opt.jl:
When installing Gurobi itself, I get the following error, mentioning a problem with installation and steps to remedy it:
Pkg.build("Gurobi")
Building Gurobi → `~/.julia/packages/Gurobi/P6eVP/deps/build.log`
┌ Error: Error building `Gurobi`:
│ ERROR: LoadError: Unable to locate Gurobi installation. If the advice above did not help,
│ open an issue at https://github.com/jump-dev/Gurobi.jl and post the full
│ print-out of this diagnostic attempt.
│
│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] top-level scope at /Users/prikshetsharma/.julia/packages/Gurobi/P6eVP/deps/build.jl:161
│ [3] include(::String) at ./client.jl:457
│ [4] top-level scope at none:5
│ in expression starting at /Users/prikshetsharma/.julia/packages/Gurobi/P6eVP/deps/build.jl:155
│
│ **Unable to locate Gurobi installation. Running some common diagnostics.**
│
│ Gurobi.jl only supports the following versions:
│
│ - gurobi90
│ - gurobi91
│
│ Did you download and install one of these versions from gurobi.com?
│ Installing Gurobi.jl via the Julia package manager is _not_ sufficient!
│
│ Found GUROBI_HOME = /Library/gurobi910/mac64/
│
│ Does this point to the correct install location?
│
│ We're going to look for the Gurobi library in this directory:
│ /Library/gurobi910/mac64/lib
│
│ That directory has the following files:
│
│ Aha! We tried looking in `/Library/gurobi910/mac64/lib`, but something went wrong. Are
│ you sure that your GUROBI_HOME environment variable is correct?
│ When combined with the appropriate suffix (e.g., `lib` or
│ `bin`, it needs to point to a valid directory.
│
│
│ You should set the `GUROBI_HOME` environment variable to point to the
│ install location then try again. For example (updating the path to the
│ correct location if needed):
│ ```
│ # On Windows, this might be
│ ENV["GUROBI_HOME"] = "C:\\Program Files\\gurobi910\\win64\\"
│ import Pkg
│ Pkg.add("Gurobi"
│ Pkg.build("Gurobi")
│
│ # On OSX, this might be
│ ENV["GUROBI_HOME"] = "/Library/gurobi910/mac64/"
│ import Pkg
│ Pkg.add("Gurobi")
│ Pkg.build("Gurobi")
│
│ # On Unix, this might be
│ ENV["GUROBI_HOME"] = "/opt/gurobi910/linux64/"
│ import Pkg
│ Pkg.add("Gurobi")
│ Pkg.build("Gurobi")
│ ```
│ **Note: your path may differ. Check which folder you installed the Gurobi
│ binary in, and update the path accordingly.**
└ # Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:949
I've already following the steps mentioned for macOS in the above trace, but I still get the above error. How to install Gurobi and use it successfully?
You need to install the standalone Gurobi package first. Please follow the instructions in these guides for more info. As was already mentioned in the comments, you should also acquire a license to run Gurobi.

IOError: stream is closed or unusable on a new genie App

I created a new Genie App as described here. :
Genie.newapp("MyGenieApp")
with routes.jl looking like that:
using Genie.Router
route("/") do
serve_static_file("welcome.html")
end
route("/hello")do
"Welcome to Genie"
end
But when accessing http://127.0.0.1:8000/ , the generic 404-Not-Found Page is shown, and this error is printed to the console:
julia> ┌ Error: / 404
└ # Genie.Router C:\Users\User\.julia\packages\Genie\1gtMT\src\Router.jl:150
┌ Error: error handling request
│ exception =
│ IOError: stream is closed or unusable
│ Stacktrace:
│ [1] check_open at .\stream.jl:328 [inlined]
│ [2] uv_write_async(::Sockets.TCPSocket, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:961
│ [3] uv_write(::Sockets.TCPSocket, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:924
│ [4] unsafe_write(::Sockets.TCPSocket, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:1007
│ [5] unsafe_write at C:\Users\User\.julia\packages\HTTP\nMACo\src\ConnectionPool.jl:174[inlined]
│ [6] macro expansion at .\gcutils.jl:91 [inlined]
│ [7] write at .\strings\io.jl:186 [inlined]
│ [8] writeheaders(::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::HTTP.Messages.Response) at C:\Users\User\.julia\packages\HTTP\nMACo\src\Messages.jl:439
│ [9] startwrite(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at C:\Users\User\.julia\packages\HTTP\nMACo\src\Streams.jl:85
│ [10] handle(::HTTP.Handlers.RequestHandlerFunction{Genie.AppServer.var"#6#12"}, ::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at C:\Users\User\.julia\packages\HTTP\nMACo\src\Handlers.jl:278
│ [11] #4 at C:\Users\User\.julia\packages\HTTP\nMACo\src\Handlers.jl:345 [inlined]
│ [12] macro expansion at C:\Users\User\.julia\packages\HTTP\nMACo\src\Servers.jl:367 [inlined]
│ [13] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.RequestHandlerFunction{Genie.AppServer.var"#6#12"}},HTTP.ConnectionPool.Transaction{Sockets.TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() at .\task.jl:333
Does someone have a clue, what I am doing wrong?
The problem was this line:
Genie.newapp("MyGenie App")
instead of using CamelCase, I actually hat a space in here. Because Genie creates files and variables with this name, a space is not allowed here.

Issues on using Plots package in Julia

I'm trying to use Plots package in Julia but I get an error message I don't fully understand. Using a Jupyter notebook I followed the canonic way to install and use the package with:
Pkg.add("Plots")
using Plots
But after then I got this error message:
INFO: Precompiling module Plots.
WARNING: Module Compat with uuid 131681569370755 is missing from the cache.
This may mean module Compat does not support precompilation but is imported by a module that does.
ERROR: LoadError: Declaring __precompile__(false) is not allowed in files that are being precompiled.
Stacktrace:
[1] _require(::Symbol) at .\loading.jl:455
[2] require(::Symbol) at .\loading.jl:405
[3] include_from_node1(::String) at .\loading.jl:576
[4] include(::String) at .\sysimg.jl:14
[5] anonymous at .\<missing>:2
while loading C:\Users\Alex\.julia\v0.6\StaticArrays\src\StaticArrays.jl, in expression starting on line 17
ERROR: LoadError: Failed to precompile StaticArrays to C:\Users\Alex\.julia\lib\v0.6\StaticArrays.ji.
Stacktrace:
[1] compilecache(::String) at .\loading.jl:710
[2] _require(::Symbol) at .\loading.jl:463
[3] require(::Symbol) at .\loading.jl:405
[4] include_from_node1(::String) at .\loading.jl:576
[5] include(::String) at .\sysimg.jl:14
[6] anonymous at .\<missing>:2
while loading C:\Users\Alex\.julia\v0.6\Plots\src\Plots.jl, in expression starting on line 7
Failed to precompile Plots to C:\Users\Alex\.julia\lib\v0.6\Plots.ji.
Stacktrace:
[1] compilecache(::String) at .\loading.jl:710
[2] _require(::Symbol) at .\loading.jl:497
[3] require(::Symbol) at .\loading.jl:405
[4] include_string(::String, ::String) at .\loading.jl:522
Could somebody please help me to understand this error and what can I do to fix it? Any help will be much appreciated.
That's because you already had Compat in your scope before trying to update. It then has an issue of trying to precompile using a new version of Compat while an old one is still in scope. To fix this, just restart Julia and do using Plots.

IJulia for Julia v0.7

I tried building the latest (dev) version of Julia (v0.7) and want to use this kernel from Jupyter Notebook. When I tried running
Pkg.add("IJulia") and building the module, the build failed. The errors I get are along the lines of
Error: ------------------------------------------------------------
│ # Build failed for IJulia
│ exception =
│ LoadError: UndefVarError: JULIA_HOME not defined
│ Stacktrace:
│ [1] uv_error at ./libuv.jl:68 [inlined]
│ [2] unlink(::String) at ./file.jl:526
│ [3] #rm#9(::Bool, ::Bool, ::Function, ::String) at ./file.jl:149
│ [4] #rm at ./<missing>:0 [inlined]
│ [5] #installkernel#2(::String, ::Function, ::String) at /Users/myuser/.julia/v0.7/IJulia/deps/kspec.jl:117
│ [6] installkernel(::String) at /Users/myuser/.julia/v0.7/IJulia/deps/kspec.jl:36
│ [7] top-level scope at /Users/myuser/.julia/v0.7/IJulia/deps/build.jl:75
│ [8] include at ./boot.jl:295 [inlined]
│ [9] include_relative(::Module, ::String) at ./loading.jl:1067
│ [10] include at ./sysimg.jl:26 [inlined]
│ [11] include(::String) at ./loading.jl:1101
│ [12] top-level scope
│ [13] eval at ./boot.jl:298 [inlined]
│ [14] eval at ./sysimg.jl:71 [inlined]
│ [15] evalfile(::String, ::Array{String,1}) at ./loading.jl:1096 (repeats 2 times)
│ [16] #2 at ./none:15 [inlined]
│ [17] cd(::getfield(, Symbol("##2#5")){String}, ::String) at ./file.jl:70
│ [18] (::getfield(, Symbol("##1#3")))(::IOStream) at ./none:14
│ [19] #open#318(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(, Symbol("##1#3")), ::String, ::Vararg{String,N} where N) at ./iostream.jl:369
│ [20] open(::Function, ::String, ::String) at ./iostream.jl:367
│ [21] top-level scope
│ [22] eval at ./boot.jl:298 [inlined]
│ [23] eval(::Module, ::Expr) at ./sysimg.jl:71
│ [24] exec_options(::Base.JLOptions) at ./client.jl:309
│ [25] _start() at ./client.jl:448
│ in expression starting at /Users/myuser/.julia/v0.7/IJulia/deps/build.jl:104
└ # Main none:18
Is it reasonable to post this as an issue on the github, or are the issues only supposed to be for the stable release v0.6?
In the upcoming Julia v0.7, the variable JULIA_HOME (from the Base module) has been renamed to Sys.BINDIR [1].
After having a look to the repository, it seems that they are currently porting IJulia to version 0.7. I don't think that it hurts to file an issue given now that you have the solution how to fix this particular issue. Also this particular error message does not show in continuous integration builds [2]. However, there a probably many other issues given the long list of changes [1] and since version 0.7 has not yet been released. Thus do not expect IJulia to to work with Julia v0.7 (dev) after this change.
[1] https://github.com/JuliaLang/julia/blob/master/NEWS.md
[2] https://travis-ci.org/JuliaLang/IJulia.jl/jobs/336988585

Glassfish warnings : Avertissement: Multiple [2] JMX MBeanServer instances exist

I use NetBeansIDE 7.0.1 with Glassfish 3.1 and for a project with EJB and JPA for the presentation and the MySQL database.
all works fine but whenever I get the following warnings:
Avertissement: Multiple [2] JMX MBeanServer instances exist, we will use the server at index [0] : [com.sun.enterprise.v3.admin.DynamicInterceptor#11bfacc].
Avertissement: JMX MBeanServer in use: [com.sun.enterprise.v3.admin.DynamicInterceptor#11bfacc] from index [0]
Avertissement: JMX MBeanServer in use: [com.sun.jmx.mbeanserver.JmxMBeanServer#24d165] from index [1]
What Glassfish configuration can solve this problem?
Thank you for your help.

Resources