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

[JOSS review] [bug?] Submitting only one lapply job fails #12

Open
mschubert opened this issue Jun 10, 2019 · 5 comments
Open

[JOSS review] [bug?] Submitting only one lapply job fails #12

mschubert opened this issue Jun 10, 2019 · 5 comments

Comments

@mschubert
Copy link

This is a part of the JOSS review outlined in openjournals/joss-reviews#1493.

The following fails:

library(sluRm)
Slurm_lapply(1, function(x) x*2)
# Error in splits[[j]] : subscript out of bounds
# In addition: Warning message:
# `X` is not a list. The function will coerce it into one using `as.list`

Related: Internal parallelism via mc.cores defaults to 2, which wastes a core if there are not more calls than jobs.

gvegayon added a commit that referenced this issue Jun 11, 2019
@gvegayon
Copy link
Member

Thanks. This should be fixed now. Regarding the default of 2 mc.cores, that's not an issue since mclapply automatically checks for this. If length(X) == 1, then mc.cores defaults to lapply instead. I was just trying to be consistent with what is in parallel.

@gvegayon
Copy link
Member

Also, this was a nasty bug. Thanks for flagging that!

@mschubert
Copy link
Author

Regarding the default of 2 mc.cores, that's not an issue since mclapply automatically checks for this. If length(X) == 1, then mc.cores defaults to lapply instead.

That's true for mclapply in R, but not for the job that requests 2 cores (and only uses 1)

@gvegayon
Copy link
Member

gvegayon commented Jun 11, 2019 via email

@gvegayon
Copy link
Member

Now in 91909a7

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