[R] inconsistency in mclapply.....

akshay kulkarni @k@h@y_e4 @end|ng |rom hotm@||@com
Fri Jun 9 20:26:38 CEST 2023


Dear members,
                         I think I have a hint:

The doc says:

mc.cleanup
             if set to TRUE then all children that have been forked by this function will be killed (by sending SIGTERM) before this function returns. Under normal circumstances mclapply waits for the children to deliver results, so this option usually has only effect when mclapply is interrupted. If set to FALSE then child processes are collected, but not forcefully terminated. As a special case this argument can be set to the number of the signal that should be used to kill the children instead of SIGTERM.
mc.allow.recursive

Unless true, calling mclapply in a child process will use the child and not fork again.

I think the child processes are not killed. I think I have to use one or both of the above arguments. Can you please shed some light on which one? ANd what goes on under the hood?
THanking you,Yours sincerely,AKSHAY M KULKARNI

________________________________
From: R-help <r-help-bounces using r-project.org> on behalf of akshay kulkarni <akshay_e4 using hotmail.com>
Sent: Friday, June 9, 2023 11:31 PM
To: R help Mailing list <r-help using r-project.org>
Subject: [R] inconsistency in mclapply.....

Dear members,
                          I am using pbmcapply to parellise my code. But the following code doesn't work:

> LYG <- pbmclapply(LYGH,FUN = arfima,mc.cores = 2,mc.preschedule = FALSE)
  |                                                                                                                                                     |   0%, ETA NA^

It just hangs.

But the following works:

>  LYG <- pbmclapply(LYGH,FUN = arfima,mc.cores = 2)
  |==============================================================================================================================================| 100%, Elapsed 00:32
>  LYG <- pbmclapply(LYGH,FUN = arfima,mc.cores = 2,mc.preschedule = FALSE)
  |==============================================================================================================================================| 100%, Elapsed 00:52

Any idea on why mc.preschedule = FALSE works after the one without it?

Many thanks ...

THanking you,

Yours sincerely,
AKSHAY M KULKARNI


        [[alternative HTML version deleted]]

______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list