stevemussmann / BayesAss3-SNPs

Modification of BayesAss 3.0.4 to allow handling of large SNP datasets
GNU General Public License v3.0
15 stars 7 forks source link

Using Bayesass in multiple core #9

Closed Dieggarp closed 2 years ago

Dieggarp commented 3 years ago

Hi Steve,

I am wondering if it is possible to parallelize Bayesass. I am working in a cluster with several nodes and it would be awesome to could use the total power of the machine to run this program. Usually, I wait 1 day to obtain results from a single running and maybe the parameters I used were wrong.

Do you know if the program could run in several cores at the same time? Or do you have some solution to improve running times?

Thanks Diego

stevemussmann commented 3 years ago

Hi Diego,

My best recommendation would be GNU Parallel: https://www.gnu.org/software/parallel/

You can put all of your commands you want to run into a text file (one command per line) named, for example "ba3_commands.txt" and then cat the file to parallel. For example: cat ba3_commands.txt | parallel

Parallel will automatically sense how many cores you have available to you and run one ba3-snps instance per available core. As one command finishes, another will start in its place.

I intend to parallelize BA3-SNPs itself someday, but have not yet had time to sit down and revise the code for this purpose.

-Steve