Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data.table crashes with segfault error while grouping with more than 65 threads #1

Closed
j3551ca opened this issue Jul 30, 2024 · 0 comments

Comments

@j3551ca
Copy link
Collaborator

j3551ca commented Jul 30, 2024

Pipeline terminates prematurely while performing group by operation with data.table on file of 100745 observations in mutation_watchlist.R.

Error executing process > 'collectTables (Generate mutation frequency and collapse into regional estimates)'

Caused by:
  Process `collectTables (Generate mutation frequency and collapse into regional estimates)` terminated with an error exit status (134)

Command executed:

  Rscript bin/mutation_watchlist.R     --concat_mutations=mutation_tables.csv     --outdir=""

Command exit status:
  134

Command output:
  (empty)

Command error:
  address 0x8d62eb8, cause 'memory not mapped'
  
   *** caught segfault ***
  address 0x8e62e08, cause 'memory not mapped'
  
   *** caught segfault ***
  address 0x8e22e0c, cause 'memory not mapped'
  
   *** caught segfault ***
  address 0x8d22e3c, cause 'memory not mapped'
  address 0x8da2e2c, cause 'memory not mapped'
  
   *** caught segfault ***
  address 0x8f62f08, cause 'memory not mapped'
  
   *** caught segfault ***
  address 0x8ee2e10, cause 'memory not mapped'
  
  Traceback:
   1: forderv(firstofeachgroup)
   2: `[.data.table`(dt_clean, , .(VAF = round((sum(AO)/sum(DP)), digits = 4)),     by = .(LOCATION, COLLECTION_DATE, ANNO))
   *** caught segfault ***
  address 0x8ea2e0c, cause 'memory not mapped'
  
   *** caught segfault ***
  address 0x8fa2df4, cause 'memory not mapped'
  Error: no more error handlers available (recursive errors?); invoking 'abort' restart
  
   3: dt_clean[, .(VAF = round((sum(AO)/sum(DP)), digits = 4)), by = .(LOCATION,     COLLECTION_DATE, ANNO)]
  
  Traceback:
  
  Traceback:
  
   *** caught segfault ***
  address 0x8c62e40, cause 'memory not mapped'
  An irrecoverable exception occurred. R is aborting now ...
  Error: no more error handlers available (recursive errors?); invoking 'abort' restart
  
   *** caught segfault ***
  address 0x8de2e10, cause 'memory not mapped'
  
  Traceback:
   1: 
  Traceback:
  Execution halted
  *** stack smashing detected ***: <unknown> terminated
  An irrecoverable exception occurred. R is aborting now ...
  Error: bad value
  .command.sh: line 2: 2713426 Aborted                 (core dumped) Rscript bin/mutation_watchlist.R --concat_mutations=mutation_tables.csv --outdir=""
  • tested script outside of Nextflow in environment envs/vcf_2_table.yml and completed successfully with expected outputs
  • adjusting memory setting in collectTables process within nextflow.config (memory = '100 GB') did not resolve
  • change threads in setDTthreads() to 20 - sets the number of threads to be used in data.table functions that are parallelized, which resolved issue.
  • error reproduced 5 times at 80 threads.
  • successful completion reproduced 5 times at 60 threads.

It seems as setDTthreads decreases, probability of successful completion increases (at the cost of duration). DT threads are now set to 60 in mutation_watchlist.R. This may need to be adjusted as dataset increases.

j3551ca added a commit that referenced this issue Jul 30, 2024
Decrease number of threads used by data.table with setDTthreads() function.
@j3551ca j3551ca closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant