lfaino / LoReAn

Long Reads Annotation pipeline
MIT License
71 stars 10 forks source link

std::bad_alloc error due to excessive memory use by diamond v0.9.26.127 with larger protein data set #30

Closed stroehleina closed 4 years ago

stroehleina commented 4 years ago

LoReAn fails with the following error when running with a larger protein (-pr option) data set (query 31,435 sequences and 17,226,327 residues, .dmnd database 3,996 sequences, 742,785,446 residues). Tested on two machines with plenty of RAM (1Tb) and cores (24-48). I have tested this with both udocker and singularity and have followed the advice from the diamond issues #315 and #176, playing around with the --algo, --block-size and --threads options, to no avail.

Computing alignments... terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
SIGABRT: abort
PC=0x47cdab m=0 sigcode=0

goroutine 1 [running, locked to thread]:
syscall.RawSyscall(0x3e, 0x45af, 0x6, 0x0, 0x0, 0xc00008e360, 0xc00008e360)
    /usr/lib/golang/src/syscall/asm_linux_amd64.s:78 +0x2b fp=0xc0001d1e70 sp=0xc0001d1e68 pc=0x47cdab
syscall.Kill(0x45af, 0x6, 0x0, 0x0)
    /usr/lib/golang/src/syscall/zsyscall_linux_amd64.go:597 +0x4b fp=0xc0001d1eb8 sp=0xc0001d1e70 pc=0x479bcb
github.com/sylabs/singularity/internal/app/starter.Master.func2()
    internal/app/starter/master_linux.go:152 +0x61 fp=0xc0001d1f00 sp=0xc0001d1eb8 pc=0x7928f1
github.com/sylabs/singularity/internal/pkg/util/mainthread.Execute.func1()
    internal/pkg/util/mainthread/mainthread.go:21 +0x2f fp=0xc0001d1f28 sp=0xc0001d1f00 pc=0x790f4f
main.main()
    cmd/starter/main_linux.go:102 +0x5f fp=0xc0001d1f60 sp=0xc0001d1f28 pc=0x972c6f
runtime.main()
    /usr/lib/golang/src/runtime/proc.go:203 +0x21e fp=0xc0001d1fe0 sp=0xc0001d1f60 pc=0x433b4e
runtime.goexit()
    /usr/lib/golang/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc0001d1fe8 sp=0xc0001d1fe0 pc=0x45f7c1

goroutine 6 [syscall]:
os/signal.signal_recv(0xb9dbc0)
    /usr/lib/golang/src/runtime/sigqueue.go:147 +0x9c
os/signal.loop()
    /usr/lib/golang/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
    /usr/lib/golang/src/os/signal/signal_unix.go:29 +0x41

goroutine 8 [chan receive]:
github.com/sylabs/singularity/internal/pkg/util/mainthread.Execute(0xc0002934f0)
    internal/pkg/util/mainthread/mainthread.go:24 +0xb4
github.com/sylabs/singularity/internal/app/starter.Master(0xa, 0x4, 0x45c0, 0xc00000eac0)
    internal/app/starter/master_linux.go:151 +0x44c
main.startup()
    cmd/starter/main_linux.go:75 +0x53e
created by main.main
    cmd/starter/main_linux.go:98 +0x35

rax    0x0
rbx    0x0
rcx    0xffffffffffffffff
rdx    0x0
rdi    0x45af
rsi    0x6
rbp    0xc0001d1ea8
rsp    0xc0001d1e68
r8     0x0
r9     0x0
r10    0x0
r11    0x202
r12    0xff
r13    0x0
r14    0xb83c50
r15    0x0
rip    0x47cdab
rflags 0x202
cs     0x33
fs     0x0
gs     0x0

When I reduce the number of input proteins to ~500, diamond runs fine.

I updated the diamond executable inside the docker container from v0.9.26.127 to v0.9.32 which solved the problem and allowed me to run the full data set (n = 31,435) without any issues:

udocker run lorean bash
cd /usr/local/bin/
wget http://github.com/bbuchfink/diamond/releases/download/v0.9.32/diamond-linux64.tar.gz
tar xzf diamond-linux64.tar.gz
exit

Could I ask you to please update the diamond version to the latest version, if there are no other dependency issues?

Thank you!

lfaino commented 4 years ago

Dear @stroehleina can you try to pull this image?

lfaino/lorean:repetmodeller

it contains the latest version of diamonds

cheers Luigi

stroehleina commented 4 years ago

Hi Luigi, this solved the problem, thank you! Nice addition with RepeatModeler, too! Thanks for the swift reply!

Cheers, Andreas