Closed nick-youngblut closed 4 years ago
Can you please provide a minimal reproducible example?
For instance, the following works for me:
fx = function(x) dplyr::rename(x, 'P' = `Pr(>F)`)
clustermq::Q(fx, x=list(tibble::tibble(`Pr(>F)` = 5)), n_jobs=1)
I can't seem to reproduce the issue, mainly because I've been messing with the code that I was using and now I can't get the function upstream of the rename
to work. I'm trying to run RRPP::lm.rrpp
, which works just fine with lapply or plyr::llply (with doParallel), but when running it with clustermq, I always get:
(Error #1) NA/NaN argument
(#1) no non-missing arguments to max; returning -Inf
I've tried so many things to try to get it working, but nothing helps.
There's not much in regards to the error reported, so it's hard to determine what the problem is. The entire error:
Error in summarize_result(job_result, n_errors, n_warnings, cond_msgs, : 3/3 jobs failed (3 warnings). Stopping.
(Error #1) NA/NaN argument
(#1) no non-missing arguments to max; returning -Inf
(Error #2) NA/NaN argument
(#2) no non-missing arguments to max; returning -Inf
(Error #3) NA/NaN argument
(#3) no non-missing arguments to max; returning -Inf
Traceback:
1. Q(.rrpp_diet, tree = host_tree_l %>% head, const = list(otu = otu,
. taxon = taxa[1], iter = iter), n_jobs = 50, job_size = 1,
. pkgs = c("plyr", "dplyr", "tidyr", "doParallel", "ape", "RRPP"),
. template = tmpl)
2. Q_rows(fun = fun, df = df, const = const, export = export, pkgs = pkgs,
. seed = seed, memory = memory, template = template, n_jobs = n_jobs,
. job_size = job_size, rettype = rettype, fail_on_error = fail_on_error,
. workers = workers, log_worker = log_worker, chunk_size = chunk_size,
. timeout = timeout, max_calls_worker = max_calls_worker, verbose = verbose)
3. master(qsys = workers, iter = df, rettype = rettype, fail_on_error = fail_on_error,
. chunk_size = chunk_size, timeout = timeout, max_calls_worker = max_calls_worker,
. verbose = verbose)
4. summarize_result(job_result, n_errors, n_warnings, cond_msgs,
. min(submit_index) - 1, fail_on_error)
5. stop(msg, ". Stopping.\n", detail)
What I don't understand is why I don't get a more descriptive error in the qsub job log file. An example of one of the jobs:
R version 4.0.0 (2020-04-24) -- "Arbor Day"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> clustermq:::worker("tcp://rick:7060")
2020-06-22 19:47:42.428020 | Master: tcp://rick:7060
2020-06-22 19:47:42.452442 | WORKER_UP to: tcp://rick:7060
2020-06-22 19:47:42.479853 | > DO_SETUP (0.019s wait)
2020-06-22 19:47:42.480455 | token from msg: babod
Attaching package: ‘dplyr’
The following objects are masked from ‘package:plyr’:
arrange, count, desc, failwith, id, mutate, rename, summarise,
summarize
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
2020-06-22 19:47:43.980770 | > DO_CHUNK (0.001s wait)
2020-06-22 19:47:44.187067 | completed 1 in 0.20s [user], 0.00s [system], 0.21s [elapsed]
2020-06-22 19:47:44.197363 | > WORKER_STOP (0.000s wait)
2020-06-22 19:47:44.197916 | shutting down worker
2020-06-22 19:47:44.277696 |
Total: 1 in 1.30s [user], 0.08s [system], 1.75s [elapsed]
>
>
My template:
#!/bin/bash
#$ -N {{ job_name }} # job name
#$ -pe parallel {{ cores | 1 }} # job threads
#$ -l h_rt={{ job_time | 00:59:00 }} # job time
#$ -l h_vmem={{ job_mem | 7G }} # job memory
#$ -t 1-{{ n_jobs }} # submit jobs as array
#$ -j y # combine stdout/error in one file
#$ -o {{ log_file | /dev/null }} # output log file
#$ -cwd # use pwd as work dir
#$ -V # use environment variable
. ~/.bashrc
conda activate {{ conda | py3 }}
export OMP_NUM_THREADS={{ omp.threads | 1 }}
export OPENBLAS_NUM_THREADS={{ blas.threads | 1 }}
export MKL_NUM_THREADS={{ mkl.threads | 1 }}
#ulimit -v $(( 1024 * {{ memory | 4096 }} ))
CMQ_AUTH={{ auth }} R --no-save --no-restore -e 'clustermq:::worker("{{ master }}")'
I would suggest you:
RRPP::lm.rrpp
runs with lapply
but fails with clustermq
.What I don't understand is why I don't get a more descriptive error in the qsub job log file. An example of one of the jobs
Worker logs keep track of processing. They are not concerned about any errors your R code produces: Rather, an error in an evaluation is a result that will be reported back. This is why you see (Error #1) NA/NaN argument
. You just, unfortunately, can not get a traceback on it.
Thanks for the clarification! I understand the need for a reprex. I'm just having a hard time creating one. It seems somehow specific to my dataset. I'll keep looking.
Ok! Please reopen if you find one.
I'm running clustermq on a function that includes:
...which generates the error:
If I remove the
rename
line from the function, the function then works correctly.SessionInfo: