(1) I know that the number of threads specified (-p option) should not be larger than the number of cores available in the system. But I am wondering if there is any fixed limit on the number of threads in running Tophat regardless how many cores are available?
In other words, if the number of threads reaches certain high number, would it possibly cause segmentation fault or not speed up the process in any way?
(2) We have 24 cores in our system. I’m not sure if using 20 threads (-p 20) to run Tophat is safe and effective? What about using 24 threads (-p 24)?
(3) Since we have many large samples to run, I’m trying to figure out a good way to parallel process them.
Between these two choices: (a) running single Tophat with “-p 20” sequentially (b) running two Tophat with “-p 10” simultaneously, which choice takes less time for the same amount of samples?
Would choice (b) be faster since Tophat has some steps which do not use multithreading (but I pre-built the transcriptome index)?
On the other hand, would choice (b) use doubled memory than choice (a) which may possibly slow down the process?
Any advice would be greatly appreciated.
Thank you very much!
You should leave a core or two so the system can use it for other essential processes. If a program tries to use all cores available the the system may become very sluggish and at worst may stop responding to external inputs.
Cores is just one part of the equation. Memory (as noted by @mastal below) is an important consideration as well. Finally you are going to be limited by the throughput of your storage subsystem. On most modern systems CPU's are never the bottleneck, since you will find that cores will generally be waiting for the data to arrive for them to work on.
Do this. Subset (100K reads) a pair of sample files. Go through the possible permutations (10 cores x 2 jobs, 20 core one job etc) with sample files and time them to figure out what looks to be optimal strategy for your system and then go with that for the larger set.
Keep in mind that once you reach the resource limits on the weakest link/component, there can be no additional speedup unless you upgrade the hardware.
Thanks a lot for your advice!
Our system has 128 GB RAM. Trapnell suggested 16 GB RAM and their presented protocol is -p 8. So does it mean about 2 GB per thread? If that’s the case, I guess our 20 threads may be OK?
So “20 threads one job” may end up using the similar memory as “10 threads x 2 jobs”, right?
But I guess “20 threads one job” has one set of bowie index allocated in the memory, while “10 threads x 2 jobs” will have two sets allocated, so “10 threads x 2 jobs” may still take more memory than “20 threads one job”?
That is precisely the kind of thing you will discover when you do the small test jobs :-)
You should have enough RAM for these jobs.
for your attention, TopHat2 declared obsolete by authors you can use instead Hisat2
Tophat does not have a limit to the number of threads for multithreaded phases, but when you have a lot of cores, Tophat's run time becomes dominated by its slow singlethreaded phases. So, it does not scale as well to large numbers of cores as alternatives (STAR, BBMap).