caravagnalab / rRACES

R wrapper for the RACES package
GNU General Public License v3.0
2 stars 1 forks source link

RStudio session aborted when high number of cells are searched #84

Closed valerianilucrezia closed 8 months ago

valerianilucrezia commented 9 months ago

In Rstudio if I run the following lines of code the Rstudio session aborted:

library(rRACES)
library(dplyr)

n_w <- n_h <- 60
ncells <- 0.8*n_w*n_h

sim <- new(Simulation, "Three Populations - Border")
sim$duplicate_internal_cells <- FALSE

sim$death_activation_level <- 50

sim$add_mutant(name = "A", growth_rates = 0.1, death_rates = 0.01)
sim$place_cell("A", 500, 500)
sim$run_up_to_size("A", 2000)

sim$add_mutant(name = "B", growth_rates = 0.1, death_rates = 0.01)
sim$mutate_progeny(sim$choose_cell_in("A"), "B")
sim$run_up_to_size("B", 3000)
plot_tissue(sim)
plot_muller(sim)

bbox <- sim$search_sample(c("A" = ncells), n_w, n_h)
sim$sample_cells("S_2A", bbox$lower_corner, bbox$upper_corner)

bbox <- sim$search_sample(c("B" = ncells), n_w, n_h)

With session info:

> utils::sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.0

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Rome
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_1.1.4  rRACES_0.4.2

loaded via a namespace (and not attached):
 [1] tidyr_1.3.1       utf8_1.2.4        R6_2.5.1          codetools_0.2-19  tidyselect_1.2.0  magrittr_2.0.3   
 [7] gtable_0.3.4      glue_1.7.0        tibble_3.2.1      pkgconfig_2.0.3   generics_0.1.3    ggplot2_3.5.0    
[13] lifecycle_1.0.4   cli_3.6.2         fansi_1.0.6       scales_1.3.0      grid_4.3.2        vctrs_0.6.5      
[19] compiler_4.3.2    purrr_1.0.2       rstudioapi_0.15.0 tools_4.3.2       munsell_0.5.0     pillar_1.9.0     
[25] Rcpp_1.0.12       colorspace_2.1-0  rlang_1.1.3 

Instead if I do the same thing on a computing node of a cluster this error is returned: Error: No bounding box found!

With following session info:

> utils::sessionInfo()
R version 4.2.3 (2023-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Fedora Linux 37 (Thirty Seven)

Matrix products: default
BLAS/LAPACK: /orfeo/cephfs/opt/programs/intel/fedora37/openBLAS/0.3.23/lib/libopenblas_skylakexp-r0.3.23.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] dplyr_1.1.4  rRACES_0.4.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.12        magrittr_2.0.3     tidyselect_1.2.0   munsell_0.5.0
 [5] ape_5.7-1          colorspace_2.1-0   lattice_0.21-9     R6_2.5.1
 [9] rlang_1.1.2        fansi_1.0.6        ggmuller_0.5.6     parallel_4.2.3
[13] grid_4.2.3         nlme_3.1-162       gtable_0.3.4       utf8_1.2.4
[17] cli_3.6.2          withr_3.0.0        digest_0.6.34      tibble_3.2.1
[21] lifecycle_1.0.4    crayon_1.5.2       farver_2.1.1       RColorBrewer_1.1-3
[25] ggplot2_3.5.0      vctrs_0.6.4        codetools_0.2-19   glue_1.7.0
[29] labeling_0.4.3     compiler_4.2.3     pillar_1.9.0       generics_0.1.3
[33] scales_1.3.0       hexbin_1.28.3      pkgconfig_2.0.3
albertocasagrande commented 9 months ago

What do you mean by aborted? Can you provide the error message you get under RStudio?

valerianilucrezia commented 9 months ago

It appears on the screen this:

Screenshot 2024-02-28 alle 15 56 18
albertocasagrande commented 9 months ago

Can you save the first script in a file named test.R and try to execute it by issuing the command Rscript test.R in the shell?

valerianilucrezia commented 9 months ago
❯ Rscript test.R

Caricamento pacchetto: ‘dplyr’

I seguenti oggetti sono mascherati da ‘package:stats’:

    filter, lag

I seguenti oggetti sono mascherati da ‘package:base’:

    intersect, setdiff, setequal, union

 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot
 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot
Messaggio di avvertimento:
No shared levels found between `names(values)` of the manual scale and the
data's alpha values.
Scale for fill is already present.
Adding another scale for fill, which will replace the existing scale.
Messaggi di avvertimento:
1: `filter_()` was deprecated in dplyr 0.7.0.
ℹ Please use `filter()` instead.
ℹ See vignette('programming') for more help
ℹ The deprecated feature was likely used in the ggmuller package.
  Please report the issue to the authors.
2: `summarise_()` was deprecated in dplyr 0.7.0.
ℹ Please use `summarise()` instead.
ℹ The deprecated feature was likely used in the ggmuller package.
  Please report the issue to the authors.
3: `group_by_()` was deprecated in dplyr 0.7.0.
ℹ Please use `group_by()` instead.
ℹ See vignette('programming') for more help
ℹ The deprecated feature was likely used in the ggmuller package.
  Please report the issue to the authors.
4: `arrange_()` was deprecated in dplyr 0.7.0.
ℹ Please use `arrange()` instead.
ℹ See vignette('programming') for more help
ℹ The deprecated feature was likely used in the ggmuller package.
  Please report the issue to the authors.
5: `select_()` was deprecated in dplyr 0.7.0.
ℹ Please use `select()` instead.
ℹ The deprecated feature was likely used in the ggmuller package.
  Please report the issue to the authors.
6: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
of ggplot2 3.3.4.
ℹ The deprecated feature was likely used in the ggmuller package.
  Please report the issue to the authors.

 *** caught bus error ***
address 0x102a38b48, cause 'invalid alignment'

Traceback:
 1: .External(list(name = "CppMethod__invoke_notvoid", address = <pointer: 0x600000b96380>,     dll = list(name = "Rcpp", path = "/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/libs/Rcpp.so",         dynamicLookup = TRUE, handle = <pointer: 0x9227e520>,         info = <pointer: 0x600002f94660>), numParameters = -1L),     <pointer: 0x600003780400>, <pointer: 0x600000b87be0>, .pointer,     ...)
 2: sim$search_sample(c(B = ncells), n_w, n_h)
An irrecoverable exception occurred. R is aborting now ...
[1]    1597 bus error  Rscript test.R
albertocasagrande commented 9 months ago

I could not reproduce the issue. However, an invalid read problem was solved by commit b6ea718ed89c7258880ee7c8797dca21f136c661. Can you reproduce the error on the last GitHub version?

albertocasagrande commented 8 months ago

Closed due to the lack of feedback.