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

Random REDCAP and SKATER crashes #33

Open
MattIwicki opened this issue Apr 7, 2022 · 1 comment
Open

Random REDCAP and SKATER crashes #33

MattIwicki opened this issue Apr 7, 2022 · 1 comment

Comments

@MattIwicki
Copy link

Hi!

I found that both Redcap and Skater algorithms randomly crash R when given too many polygons. The crash was recreated on different machines, including RStudio Cloud.

library(sf)
library(rgeoda)

# creating test geometry with random values
sfc = st_sfc(st_polygon(list(rbind(c(0,0), c(1,0), c(1,1), c(0,0)))))
grid = st_make_grid(sfc, cellsize = 0.02, square = F)
grid = st_sf(geom = grid)
grid$value = runif(nrow(grid))

# assigning weights
w = queen_weights(grid)

# looping the redcap algorithm
# using print to see after how many iterations R crashes
for(i in 100:1){
  print(i)
  redcap(10, w, grid[,"value"])
}
@Nowosad
Copy link

Nowosad commented May 18, 2022

Note: This problem does not occur for cpu_threads = 1 (when parallel processing is not used).

library(sf)
library(rgeoda)
sfc = st_sfc(st_polygon(list(rbind(c(0,0), c(1,0), c(1,1), c(0,0)))))
grid = st_make_grid(sfc, cellsize = 0.02, square = F)
grid = st_sf(value = runif(length(grid)), geom = grid)

w = queen_weights(grid)

for(i in 100:1){
  print(i)
  redcap(10, w, grid[,"value"], cpu_threads = 1)
}

Related issue: #27

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

2 participants