Dear all,
I am a computational physicist and a novice Julia programmer.I have written several simple codes using Julia, although mostly they still look like Fortran .
With the release of Julia 0.7.0-alpha, I have been trying to update my code.
So far so good until I came to this serious problem (IMHO) which make me to hard restart my laptop several times.
I am sorry because I could not present the minimal code that reproduce the problem I have faced because I could not risk to do any more hard restart again on my laptop.
I will just give the link to github of the problematic code below.
The code is my effort to refactor PyQuante.jl code of Rick Mueller.
Using Julia 0.6.3 the code runs fine. However, when I use 0.7.0-alpha, I got the following error:
ERROR: LoadError: LoadError: error in method definition: function Base.push! must be explicitly imported to be extended
Stacktrace:
[1] top-level scope
[2] include at ./boot.jl:314 [inlined]
[3] include_relative(::Module, ::String) at ./loading.jl:1071
[4] include(::Module, ::String) at ./sysimg.jl:29
[5] include(::String) at ./client.jl:393
[6] top-level scope
[7] include at ./boot.jl:314 [inlined]
[8] include_relative(::Module, ::String) at ./loading.jl:1071
[9] include(::Module, ::String) at ./sysimg.jl:29
[10] exec_options(::Base.JLOptions) at ./client.jl:267
[11] _start() at ./client.jl:427
in expression starting at /home/efefer/WORKS/my_github_repos/ElectronicStructure.jl/ffr-ElectronicStructure.jl/LO_Gaussian/CGBF.jl:44
in expression starting at /home/efefer/WORKS/my_github_repos/ElectronicStructure.jl/ffr-ElectronicStructure.jl/LO_Gaussian/test_BasisSet.jl:9
So, I try to import Base.push!
in file CGBF.jl:
import Base.push!
# This should become the constructor along with center and power
function push!(cbf::CGBF,expn,coef)
Base.push!(cbf.pgbfs, PGBF(expn, cbf.center, cbf.power))
Base.push!(cbf.coefs, coef)
normalize!(cbf)
end
When I do it like this the code run at some point before call to this function and then it hang up. I first thought that this is not a Julia problem and simply my laptop hangs (again because of unknown problem, which happened sometimes).
However, I run into this problem again when running julia-0.7.0-alpha test_BasisSet.jl
. After several hard restart, I tried to make sense of this problem and try to see what happened to my laptop when I run this. So, I open up htop
and observed that memory usage of Julia jumps up to 55% and before my laptop hang up.
I have encountered the hang up problems when I used Julia before (mainly because I tried to construct sparse matrix using kron
), but this problem is the most severe I have encountered so far.
This problem might be solved if I avoid using push and allocate memory beforehand which is the usual way I am handling this problem in Fortran. However, I might use push! somewhere and be aware of this problem.
Any help will be appreciated.
Best regards,
Fadjar Fathurrahman
I am using Ubuntu 16.04, 64 bit
julia> Sys.total_memory()/2^20
3835.27734375
julia> Sys.cpu_
cpu_info cpu_summary
julia> Sys.cpu_info()
2-element Array{Base.Sys.CPUinfo,1}:
Intel(R) Pentium(R) CPU B980 @ 2.40GHz:
speed user nice sys idle irq
840 MHz 37364 s 141 s 7177 s 272661 s 0 s
Intel(R) Pentium(R) CPU B980 @ 2.40GHz:
speed user nice sys idle irq
971 MHz 40149 s 239 s 7743 s 268268 s 0 s