arboreto icon indicating copy to clipboard operation
arboreto copied to clipboard

How to set the number of cores used by GRNboost2

Open divyanshusrivastava opened this issue 1 year ago • 1 comments

I cannot find any parameter which limits the number of cores used in GRNboost2. I am using a shared server, and my code is blocking all the resource available. Wha tcould be way the limit it to only use a predefined number of nodes, similar to '--num-worker' argument in the command line grnboost call. ?

divyanshusrivastava avatar Mar 13 '23 14:03 divyanshusrivastava

One way of doing this could be to create a client with a local cluster already set to the number of workers to use. Something like

from distributed import Client, LocalCluster client = Client(LocalCluster( name='grn_call', n_workers=4, threads_per_worker=4
))

adjacencies = grnboost2( ex_matrix, tf_names=tf_names, client_or_address=client )

divyanshusrivastava avatar Mar 13 '23 14:03 divyanshusrivastava