Re: [Bioc-devel] BiocParallel load balancing and runtime

2023-08-08 Thread Jiefei Wang
Hello Anna, The speed of parallel computing depends on many factors. To avoid any potential confounders, Please try to use this code for timing (assuming you still have all the variables you used in your example) ``` parallel_param <- SnowParam(workers = ncores, type = "SOCK", tasks =

[Rd] The enclosed environment does not work as expected

2022-04-02 Thread Jiefei Wang
Hi, It seems like the enclosed environment does not work well with the loop. Here is a simple example ``` FuncGenerator <- function(value){ function() message(value) } funcSets <- list() for(i in 1:2) funcSets[[i]] <- FuncGenerator(i) environment(funcSets[[1]])$value # [1] 2

[Rd] Great overhead for setTimeLimit?

2021-12-06 Thread Jiefei Wang
Hi all, >From the document of 'setTimeLimit', it states "Setting any limit has a small overhead – well under 1% on the systems measured.", but something is wrong with my benchmark code, enabling the time limit makes my benchmark 1x slower than the benchmark without the limit. Below is an example

Re: [Rd] How is the environment variable "R_USER" defined?

2021-11-22 Thread Jiefei Wang
uments linked to OneDrive (either by your choice > or by some administrator setting a group policy)? If so, ou could unlink it > using OneDrive's settings dialog. Or you could set R_USER to avoid using > ...\Documents. > > -Bill > > On Mon, Nov 22, 2021 at 8:4

[Rd] How is the environment variable "R_USER" defined?

2021-11-22 Thread Jiefei Wang
Hi, I have a new win system and try to install R as usual. Somehow, the environment variable "R_LIBS_USER" is incorrectly pointed to a Onedrive folder. Since "R_LIBS_USER" depends on "R_USER", the root problem then becomes why "R_USER" is the path to the Onedrive. I did an exhausting search in the

Re: [Bioc-devel] Problems with BiocParallel on Windows

2021-10-25 Thread Jiefei Wang
it still fails and says it doesn't find the function > "mandatory_is_vars()" which is a function exported by the package > > > > On 10/25/21, 13:49, "Jiefei Wang" wrote: > > > > What do you mean by "exported functions are inv

Re: [Bioc-devel] Problems with BiocParallel on Windows

2021-10-25 Thread Jiefei Wang
I mean that trying to modify the code of one of the functions that raises > errors and setting the option "exportglobals = TRUE" on SnowParam, somehow it > still fails and says it doesn't find the function "mandatory_is_vars()" which > is a function exported by the package &g

Re: [Bioc-devel] Problems with BiocParallel on Windows

2021-10-25 Thread Jiefei Wang
What do you mean by "exported functions are invisible to SnowParam workers"? Please provide more details. If you call 'bplapply' with a function from your package, it should be visible to the worker. ___ Bioc-devel@r-project.org mailing list

Re: [Bioc-devel] Problems with BiocParallel on Windows

2021-10-25 Thread Jiefei Wang
Hi Giulia, One of your errors is raised from L1288 in the file "analysis-functions.R" if (getOption("ISAnalytics.verbose") == TRUE) { ... } The error message is "argument is of length zero". Usually, this means something is wrong with the global option. Then I see at L4812 in

[Bioc-devel] Looking for suggestions for BiocParallel

2021-10-06 Thread Jiefei Wang
Dear all, We are preparing for the new devel branch for Bioc 3.15, so we look for suggestions for BiocParallel from our community. If you think there is anything we can improve, please feel free to leave your comments here: https://github.com/Bioconductor/BiocParallel/issues/160 Cheers, Jiefei

Re: [Bioc-devel] Spurious "dims [product 864] do not match the length of object [432]" on macOS

2021-09-25 Thread Jiefei Wang
Hi, If you are a newbie to the terminal, all you need to do is to extract the R code from your vignette using `R CMD Stangle xcms-lcms-ms.Rmd`(assume you are under the vignettes directory). Then use `R -d valgrind -f xcms-lcms-ms.R` to check for the memory issue. In the ideal case, it can

Re: [Rd] User interrupts parallel excution. Why it works or why not?

2021-07-20 Thread Jiefei Wang
t; the onintrEx() function, etc. A good source on signal handling is e.g. > http://www.linusakesson.net/programming/tty/ > > Best > Tomas > > On 7/20/21 9:55 AM, Jiefei Wang wrote: > > Hi all, > > > > I just notice this interesting problem a few days bef

[Rd] User interrupts parallel excution. Why it works or why not?

2021-07-20 Thread Jiefei Wang
Hi all, I just notice this interesting problem a few days before, but I cannot find an answer for it. Say if you have a long-running job in a cluster made by the parallel package and you decide to stop the execution by pressing ctr + c in the terminal or the stop button in Rstudio for some

Re: [Rd] Possible ALTREP bug

2021-05-28 Thread Jiefei Wang
Hi Gabor, Calling back to an R function from the ALTREP function is not safe. There has been a heated discussion on why you should not do it and that the main reason that we do not have any R level ALTREP API. If you are interested in it you can find it from this issue:

Re: [Rd] Surprising behavior when using the reference class with the dollar symbol

2021-03-27 Thread Jiefei Wang
s before backticks could be used to make > symbol literals for symbols that included odd things like spaces and > dollar signs. > > -Bill > > On Sat, Mar 27, 2021 at 7:49 AM Jiefei Wang wrote: > > > > Thanks, Duncan. Below is the repost of my question in plain text mode.

Re: [Rd] Surprising behavior when using the reference class with the dollar symbol

2021-03-27 Thread Jiefei Wang
purpose as the above example works for both list and S4 system. Best, Jiefei On Sat, Mar 27, 2021 at 10:20 PM Duncan Murdoch wrote: > > On 27/03/2021 10:16 a.m., Jiefei Wang wrote: > > Hi all, > > > > I'm trying to get the field value of a reference object by the field

[Rd] Surprising behavior when using the reference class with the dollar symbol

2021-03-27 Thread Jiefei Wang
Hi all, I'm trying to get the field value of a reference object by the field name, but the dollar symbol behaves quite unusual. See example below *.foo <- setRefClass("foo",fields = list(a = "integer" ))x <- .foo$new(a=1L)## This is OKx$a## This is OK`$`(x, "a")##

Re: [Rd] [External] Two ALTREP questions

2020-11-21 Thread Jiefei Wang
Bugzilla sounds like a good place to start, I will send an email to acquire an account. Best, Jiefei On Sun, Nov 22, 2020 at 6:57 AM wrote: > On Sat, 21 Nov 2020, Jiefei Wang wrote: > > > Hello, > > > > I have two related ALTREP questions. It seems like there is no way to > &g

[Rd] Two ALTREP questions

2020-11-21 Thread Jiefei Wang
Hello, I have two related ALTREP questions. It seems like there is no way to assign attributes to an ALTREP vector without using C++ code. To be more specifically, I want to make an ALTREP matrix, I have tried the following R code but none of them work. ``` .Internal(inspect(1:6))

Re: [Rd] [External] Something is wrong with the unserialize function

2020-10-29 Thread Jiefei Wang
t; >con <- file(filePath, "wrb") > >writeBin(rep(0.0,10),con) > >close(con) > > > >library(simplemmap) > >x <- mmap(filePath, "double") > >saveRDS(x, file = "x.Rds") > > > >## in a separ

[Rd] Something is wrong with the unserialize function

2020-10-29 Thread Jiefei Wang
Hi all, I am not able to export an ALTREP object when `gctorture` is on in the worker. The package simplemmap can be used to reproduce the problem. See the example below ``` ## Create a temporary file filePath <- tempfile() con <- file(filePath, "wrb") writeBin(rep(0.0,10),con) close(con)

Re: [Rd] Is there any way to check the class of an ALTREP?

2020-10-19 Thread Jiefei Wang
there is no such function in R to get the class of an ALTREP object for the SEXP struct is very compact and this less-important information might not be stored when an ALTREP object is created. Best, Jiefei On Mon, Oct 19, 2020 at 8:37 PM Jiefei Wang wrote: > Thank Denes for the clarification, glad to see

Re: [Rd] Is there any way to check the class of an ALTREP?

2020-10-19 Thread Jiefei Wang
s to the OP's own package :) I > > think Jiefei would like to know how one can "officially" determine if an > > arbitrary ALTERP object belongs to a class that he owns. > > > > Regards, > > Denes > > > > > > On 10/19/20 10:22 AM, Benjami

[Rd] Is there any way to check the class of an ALTREP?

2020-10-19 Thread Jiefei Wang
Hi all, I would like to determine if an ALTREP object is from my package, I see there is a function `ALTREP_CLASS` defined in RInternal.h but its return value is neither a `R_altrep_class_t` object nor an STRSXP representing a class name. I do not know how to correctly use it. Any suggestions?

Re: [Rd] Coercion function does not work for the ALTREP object

2020-10-07 Thread Jiefei Wang
Hi Gabriel, here is a simple package for reproducing the problem. https://github.com/Jiefei-Wang/testPkg Best, Jiefei On Thu, Oct 8, 2020 at 5:04 AM Gabriel Becker wrote: > Jiefei, > > Where does the code for your altrep class live? > > Thanks, > ~G > > On Wed, Oct 7

[Rd] Coercion function does not work for the ALTREP object

2020-10-07 Thread Jiefei Wang
Hi all, The coercion function defined for the ALTREP object will not be called by R when an assignment operation implicitly introduces coercion for a large ALTREP object. For example, If I create a vector of length 10, the ALTREP coercion function seems to work fine. ``` > x <- 1:10 > y <-

Re: [Bioc-devel] MPFE Bioconductor package

2020-09-18 Thread Jiefei Wang
ciences Institute > Building 145 > Australian National University > > Phone: 61-2-61250730 > E-mail: conrad.bur...@anu.edu.au > Web page: http://maths.anu.edu.au/people/conrad-burden > > > On 17 Sep 2020, at 8:36 pm, Jiefei Wang wrote: > >

Re: [Bioc-devel] MPFE Bioconductor package

2020-09-17 Thread Jiefei Wang
Hi Conrad, Just a friendly reminder, there is a bug in your package. Here is the build result from the link you provided: == --- Error message --- --- failure: length > 1 in coercion to logical --- --- call from argument --- columns < 1 || columns >

Re: [Bioc-devel] DECIPHER questions

2020-09-16 Thread Jiefei Wang
Hi Henry, It seems like you are using a Bioconductor package. Why not directly ask the author of the package(eswri...@pitt.edu)? JFYI, here is the link for the package, it seems like the author has written a lot of documentation for the package:

Re: [Rd] [External] Thread-safe R functions

2020-09-14 Thread Jiefei Wang
a global lock you >> need to keep in mind that any function in the R API can signal an >> error and execute a longjmp, so you need to make sure you have set a >> top level context in your thread. >> >> Best, >> >> luke >> >> On Sun,

[Rd] Thread-safe R functions

2020-09-13 Thread Jiefei Wang
Hi, I am curious about whether there exist thread-safe functions in `Rinternals.h`. I know that R is single-threaded designed, but for the simple and straightforward functions like `DATAPTR` and `INTEGER_GET_REGION`, are these functions safe to call in a multi-thread environment? Best, Jiefei