Issue importing PyPlot when submitting Julia file to cluster via Torque

跟風遠走 提交于 2021-01-05 20:31:46

问题


I am running some Julia code on my school's cluster. The .bps file which calls test_julia.jl is given below:

1 #!/bin/tcsh   
2    
3 #PBS -l walltime=24:00:00  
 4 #PBS -l nodes=1:ppn=1   
5 #PBS -N test_julia   
6 ##PBS -q normal   
7 #PBS -q normal 
8 #PBS -j oe  
9 #PBS -o ./log/julia.${PBS_JOBID}.out  
10 ##PBS -e ./log/julia.${PBS_JOBID}.err 
11 ##PBS -m abe -M myemail@school.edu  
12 #PBS -t 1-38  
13   
14  
15 cd $PBS_O_WORKDIR    
16   
17 module load julia  
18   
19 julia /path/to/file/test_julia.jl 10 20 30  
20

where 10, 20, and 30 are the input for test_julia.jl. This .jl file itself runs fine when I run it by itself. In the .jl file, I've called

1 import Distributed
2 using Distributed
3 
4 @everywhere pushfirst!(Base.DEPOT_PATH,"/tmp/test.cache")

at the beginning.

When I submit the above file with Torque, I got the following error in the .out files:

 1 Warning: no access to tty (Bad file descriptor).
  2 Thus no job control in this shell.
  3 
  4 signal (6): Aborted
  5 in expression starting at /data/heathjo/.julia/packages/PyPlot/XHEG0/src/colormaps.jl:4
  6 gsignal at /lib64/libc.so.6 (unknown line)
  7 abort at /lib64/libc.so.6 (unknown line)
  8 jl_intref at /buildworker/worker/package_linux64/build/src/typemap.c:190 [inlined]
  9 mtcache_hash_lookup at /buildworker/worker/package_linux64/build/src/typemap.c:251 [inlined]
 10 jl_typemap_intersection_visitor at /buildworker/worker/package_linux64/build/src/typemap.c:526
 11 jl_method_table_insert at /buildworker/worker/package_linux64/build/src/gf.c:1622
 12 _jl_restore_incremental at /buildworker/worker/package_linux64/build/src/dump.c:2174
 13 jl_restore_incremental at /buildworker/worker/package_linux64/build/src/dump.c:3159
 14 _include_from_serialized at ./loading.jl:617
 15 _require_search_from_serialized at ./loading.jl:713
 16 _require at ./loading.jl:937
 17 require at ./loading.jl:858
 18 require at ./loading.jl:853
 19 jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2219
 20 jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1571 [inlined]
 21 call_require at /buildworker/worker/package_linux64/build/src/toplevel.c:397 [inlined]
 22 eval_import_path at /buildworker/worker/package_linux64/build/src/toplevel.c:432
 23 jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:630
 24 jl_parse_eval_all at /buildworker/worker/package_linux64/build/src/ast.c:883
 25 jl_load at /buildworker/worker/package_linux64/build/src/toplevel.c:826
 26 include at ./boot.jl:326 [inlined]
 27 include_relative at ./loading.jl:1038
 28 include at ./sysimg.jl:29 [inlined]
 29 include at /data/heathjo/.julia/packages/PyPlot/XHEG0/src/PyPlot.jl:2
 30 jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2219
 31 do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:323
 32 eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:411
 33 eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:362 [inlined]
 34 eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:773
 35 jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:885
 36 unknown function (ip: 0xfffffffffffffffe)
 37 unknown function (ip: 0x2aaab83d046f)
 38 unknown function (ip: 0xffffffffffffffff)
 39 jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:894
 40 jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
 41 jl_eval_module_expr at /buildworker/worker/package_linux64/build/src/toplevel.c:179
 42 jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:614
 43 jl_parse_eval_all at /buildworker/worker/package_linux64/build/src/ast.c:883
 44 jl_load at /buildworker/worker/package_linux64/build/src/toplevel.c:826
 45 include at ./boot.jl:326 [inlined]
 46 include_relative at ./loading.jl:1038
 47 include at ./sysimg.jl:29
 48 jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2219
49 do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:323
 50 eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:411
 51 eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:362 [inlined]
 52 eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:773
 53 eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:689
 54 jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:885
 55 unknown function (ip: 0xfffffffffffffffe)
 56 unknown function (ip: 0x2aaab8b7761f)
 57 unknown function (ip: 0x2)
 58 jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:894
 59 jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
 60 jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:793
 61 eval at ./boot.jl:328 [inlined]
 62 eval at ./client.jl:404
 63 jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2219
 64 top-level scope at ./none:3
 65 jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1864
 66 jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:758
 67 jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:793
 68 eval at ./boot.jl:328
 69 jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2219
 70 exec_options at ./client.jl:243
 71 _start at ./client.jl:436
 72 jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2219
 73 jl_apply at /buildworker/worker/package_linux64/build/ui/../src/julia.h:1571 [inlined]
 74 true_main at /buildworker/worker/package_linux64/build/ui/repl.c:96
 75 main at /buildworker/worker/package_linux64/build/ui/repl.c:217
 76 __libc_start_main at /lib64/libc.so.6 (unknown line)
 77 _start at /gsfs0/public/julia/julia-1.1.0/bin/julia (unknown line)
 78 Allocations: 7287740 (Pool: 7286538; Big: 1202); GC: 15
 79 ERROR: LoadError: Failed to precompile PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee] to /tmp/test.cache/compiled/v1.1/PyPlot/oatAj.ji.
 80 error(::String) at ./error.jl:33
 81 compilecache(::Base.PkgId, ::String) at ./loading.jl:1197
 82 _require(::Base.PkgId) at ./loading.jl:960
 83 require(::Base.PkgId) at ./loading.jl:858
 84 require(::Module, ::Symbol) at ./loading.jl:853
 85 eval at ./boot.jl:328 [inlined]
 86 (::getfield(Distributed, Symbol("##164#166")){Module,Expr})() at ./task.jl:259
 87 Stacktrace:
 88  [1] sync_end(::Array{Any,1}) at ./task.jl:226
 89  [2] macro expansion at ./task.jl:245 [inlined]
 90  [3] remotecall_eval(::Module, ::Array{Int64,1}, ::Expr) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Distributed/src/macros.jl:206
 91  [4] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Distributed/src/macros.jl:190
 92  [5] include at ./boot.jl:326 [inlined]
 93  [6] include_relative(::Module, ::String) at ./loading.jl:1038
 94  [7] include(::Module, ::String) at ./sysimg.jl:29
 95  [8] exec_options(::Base.JLOptions) at ./client.jl:267
 96  [9] _start() at ./client.jl:436
 97 in expression starting at /gsfs0/data/heathjo/Projects/Phase_Transitions_in_QA_Circuits/Acceptable_Code/Entropy_vs_L_and_p/Entropy_Plotter.jl:7
 98 ssh: No match.
                                                        

I really don't know what to make of this error, or how I should modify my .bps file to fix it. It seems to have something to do with PyPlot (which I call in test_julia.jl), but I never get this error if I run test_julia.jl directly. I also only get this error when calling PyPlot, and none of the other packages I called beforehand in the .jl file. Is there any easy way to fix this?

来源:https://stackoverflow.com/questions/65557015/issue-importing-pyplot-when-submitting-julia-file-to-cluster-via-torque

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!