What does this command implies in bwa mem
bwa mem -t 8 index/referencegenome.fna read1.fastq.gz read2.fastq.gz > output.sam"""
-t 8 stands for here?
-t is an important parameter here and is important to understand. bwa is a CPU calculation and the more CPUs the job (calculation) is spread across the faster the calculation will take to complete and the less chance of the calculation exceeding the RAM capacity of the machine. "Exceeding RAM capacity" (I don't know the technical term), is when the process "grinds to a halt" and never completes.
Basically what can happen is the indexing step instead of taking ~3 hours, could easily be still running after 24 hours if the machine has little RAM and
-t isn't set sufficiently high.
One CPU is known as "one core".
For a regular desktop if you set
-t X where X is number of CPUs - 1 in my opinion that is good practice. So if the machine has 8 CPUs then X = 7. If you are working on a cluster, e.g. GCP or AWS, then X is the maximum number of cores (CPUs) available.
When you have questions on software then the first thing is to do your due diligence and read the manual:
Then simply checking for the "-t" argument will tell you that it is the number of threads used for the alignment process.