About try() function in parallel computing

38 Views Asked by At

I am using pbapply::pblapply(.., FUN = myfun, ..) to do some parallel computing. Inside the myfun, I use try(my_algo(), silent = T) to catch errors for the algorithm. This algorithm sometimes meets error messages but still returns a value. However, after using the try() function, I can't get the value but only the error message. If I run the my_algo() without parallel computation, it will return the value. It seems whether or not getting the value has to do with the pbapply::pblapply(). But if I ignore the error without using try() and still use pbapply::pblapply(), the execution will stop when error is incurred. So is there a way to suppress the error and get the value for results, while still computing the algorithm in parallel?

0

There are 0 best solutions below