通过 Torque 将 Julia 文件提交到集群时导入 PyPlot 的问题

问题描述

我正在学校的集群上运行一些 Julia 代码。调用 test_julia.jl 的 .bps 文件如下:

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

其中 10、20 和 30 是 test_julia.jl 的输入。当我自己运行这个 .jl 文件时,它本身运行良好。在 .jl 文件中,我调用了

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

开头。

当我使用 Torque 提交上述文件时,.out 文件中出现以下错误:

 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.
                                                        

我真的不知道如何处理这个错误,或者我应该如何修改我的 .bps 文件来修复它。它似乎与 PyPlot(我在 test_julia.jl 中调用它)有关,但是如果我直接运行 test_julia.jl,我永远不会收到此错误。我也只在调用 PyPlot 时收到此错误,而我事先在 .jl 文件中调用的其他包都没有。有什么简单的方法可以解决这个问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...