bpok
Resume computation with partial results
Identifies unsuccessful results returned from bplapply
,
bpmapply
, bpvec
, bpaggregate
or bpvectorize
.
bpresume
and bplaterror
have been deprecated.
Usage
bpok(x)
## Deprected: bpresume(expr) bplasterror()
Arguments
 x

Results returned from a call to
bp*lapply
.  expr

A expression to be reevaluated. If the original error was due to
input error,
X
should be modified. If hardware limitations or failure caused the error this expression may be the same as the original.
Details
 bpok
Returns a
logical()
vector: FALSE for any jobs that resulted in an error.x
is the result list output bybplapply
,bpmapply
,bpvec
,bpaggregate
orbpvectorize
.  bpresume
THIS FUNCTION IS DEPRECATED.
The resume mechanism allows computations with errors to be reattempted
and is triggered when the argument
catch.errors
isTRUE
. Unsuccessful results returned frombp*lapply
can be identified withbpok
. Failure may have been due to faulty input or hardware error. Incomplete portions of the job can be reattempted withbpresume
. New results are merged with the previous and returned to the user.  bplasterror
THIS FUNCTION IS DEPRECATED.
Use
attr
on the output ofbp*apply
to see traceback. See examples.
Examples
## 
## Catch errors:
## 
## By default 'catch.errors' is TRUE in BiocParallelParam objects.
SnowParam(workers = 2)
## If 'catch.errors' is FALSE an illfated bplapply() simply stops
## displaying the error message.
param < SnowParam(workers = 2, catch.errors = FALSE)
## Not run:
# > res < bplapply(list(1, "two", 3), sqrt, BPPARAM = param)
# Error in checkForRemoteErrors(val) :
# one node produced an error: nonnumeric argument to mathematical function
# ## End(Not run)
## When 'catch.errors' is TRUE partial results are returned with
## the error.
param < SnowParam(workers = 2)
X < list(1, "two", 3)
res < bplapply(X, sqrt, BPPARAM = param)
res
## Check for errors:
fail < !bpok(res)
fail
## Access the traceback with attr():
tail(attr(res[[2]], "traceback"), 5)
## 
## Resume calculations:
## 
## The 'resume' mechanism is triggered by supplying a list of partial
## results as 'BPREDO'. Data elements that failed are rerun and merged
## with previous results.
## A call of sqrt() on the character "2" returns an error.
param < SnowParam(workers = 2)
X < list(1, "two", 3)
res < bplapply(X, sqrt, BPPARAM = param)
res
## Fix the input data by changing the character "2" to a numeric 2:
X_mod < list(1, 2, 3)
## Repeat the original call to bplapply() with the partial results as 'BPREDO':
bplapply(X_mod, sqrt, BPPARAM = param , BPREDO = res)
Community examples
Looks like there are no examples yet.