wwylab / DeMixT

GNU General Public License v3.0
32 stars 14 forks source link

nthread was not taken #23

Closed arraytools closed 1 year ago

arraytools commented 1 year ago

Hello,

It seems the 'nthread' parameter was not taken when the "GS" (default) method was used in DeMixT(). When I checked the source code, https://github.com/wwylab/DeMixT/blob/master/R/DeMixT.R#L180 the nthread parameter was not passed to the DeMixT_GS() function and (parallel::detectCores() - 1 ) was used instead.

-Ming

jiyunmaths commented 1 year ago

@arraytools Thanks for your question. Can I ask if you are using a MacOS machine to run DeMixT? As we state in the ReadMe file, DeMixT relies on OpenMP for parallel computing. Starting from R 4.00, R no longer supports OpenMP on MacOS, meaning the user can only run DeMixT with one core on MacOS. For this scenario, DeMixT() ignores the nthread you specify and only uses one core. We recommend you to run DeMixT using a Linux or Windows machine. Thanks.

arraytools commented 1 year ago

thank you for the reply. I run DeMixT on a linux cluster. I specify nthread=64 in DeMixT() with "GS" method and the code still uses 127 cpus which is obvious over the limit of the specification of the job. As I point out the source code, the call to DeMixT_GS() does not honor the nthread parameter from DeMixT() function.

jiyunmaths commented 1 year ago

@arraytools I am sorry for the problem. I fixed it. The GitHub was updated. Please install DeMixT again using devtools::install_github("wwylab/DeMixT"). Thanks!

arraytools commented 1 year ago

This works. Thanks!

jiyunmaths commented 1 year ago

The issues was addressed.