STAR shared memory function not working using LoadAndRemove option

1,790 views
Skip to first unread message

hmge...@nygenome.org

unread,
Feb 4, 2014, 4:50:39 PM2/4/14
to rna-...@googlegroups.com
We have been using the STAR aligner to align multiple samples at once using the same genome. We thus want to use the shared memory function to minimize memory usage, versus having each alignment using ~30G of memory individually. We tried running STAR to utilize shared memory using the genome LoadAndRemove option, so that the genome in shared memory would be deleted once all the alignment jobs attached to it completed. However we found when using LoadAndRemove that the shared memory was not being utilized, but instead a new genome was being put into memory for each alignment job on a given node. 

We found that when we switched to LoadAndKeep, the shared memory did get utilized, and the genome was shared between alignment jobs utilizing the same genome. This is not ideal though because we then have to remove the shared memory object after the job completes. It would be better if this removal happened automatically. Do you know why the LoadAndRemove command might not be working with allowing the alignments to share memory? Not sure if this is an issue with STAR or whether we need to fix our system settings. However the shared memory does work with the LoadAndKeep option, so it is not a matter of just enabling shared memory on the system.

Alexander Dobin

unread,
Feb 4, 2014, 6:10:40 PM2/4/14
to rna-...@googlegroups.com
Hi,

I have just checked this option, and you are right - it does not work as I thought it should. I will make a patch and release it tomorrow.

Cheers
Alex

Alexander Dobin

unread,
Feb 5, 2014, 4:00:15 PM2/5/14
to rna-...@googlegroups.com
I have fixec this problem, please try this patch:
ftp://ftp2.cshl.edu/gingeraslab/tracks/STARrelease/Alpha/STAR_2.3.1z.tgz

A job with --genomeLoad LoadAndRemove option will behave as follows:
If the genome is not in the shared memory, the job will load the genome.
If genome is in the shared memory, the job will attach itself to the loaded genome.
Other jobs with the same genome directory will be allowed to attach to it.
At the exit, the job will check whether any other jobs are attached to the genome. If so, the genome will be left in memory. If not, the genome will be removed from memory.

Note, that if a job with this option terminates prematurely, it will not be able to remove the genome from memory. 
You will have to run another job with --genomeDir <...> --genomeLoad Remove options.

Please let me know if it works for you now.
Cheers
Alex



If the genome is in shared memory, the 

hmge...@nygenome.org

unread,
Mar 6, 2014, 1:40:44 PM3/6/14
to rna-...@googlegroups.com
The new version of STAR (2.3.1z) works great! We recently had a new project with lots of samples (and thus STAR jobs) running on the same node and nothing crashed, so the shared memory function seems to be up and running now.Thanks for your help!

Jonathan

unread,
May 6, 2014, 7:06:22 PM5/6/14
to rna-...@googlegroups.com
Hi, I'd like to try out this patch (ver. 2.3.1z?) although the link in the earlier email seems broken.  Any way to get that file?

Cheers,
Jonathan

Alexander Dobin

unread,
May 6, 2014, 11:09:07 PM5/6/14
to rna-...@googlegroups.com

Pai Zhang

unread,
May 31, 2017, 5:19:18 PM5/31/17
to rna-star
Hi,

We are also using STAR aligner to align multiple samples. I want to use LoadAndKeep option, but I am not do not know how to use it. 

Could you please give me some tutorial about how to use LoadAndKeep option using shared memory? 

I would appreciate a lot. 

Thank you so much.

Best,
Pai

在 2014年2月4日星期二 UTC-8下午1:50:39,hmge...@nygenome.org写道:

Alexander Dobin

unread,
May 31, 2017, 6:02:19 PM5/31/17
to rna-star
Hi Pai,

you need to use the --genomeDir /path/to/genomedir/ --genomeLoad LoadAndKeep options for all samples you want to map to the same genome.
You can start multiple jobs at the same time, or start the jobs one after another. After all the jobs are finished, you need to run 
$ STAR  --genomeDir /path/to/genomedir/ --genomeLoad Remove

Cheers
Alex

Pai Zhang

unread,
Jun 2, 2017, 10:39:55 PM6/2/17
to rna-star
Hi Alex,

Thank you for your help. Should I create the shared memory manually? Or STAR will create the shared memory automatically?

And in our group, we run STAR in a docker container. Is there a way we can save loaded genome in a docker image so that we do not need to load the genome every time when we want to map the samples? Do you have some ideas about that?

Again thank you so much. Look forward to hearing from you.

Best,
Pai

在 2017年5月31日星期三 UTC-7下午3:02:19,Alexander Dobin写道:

Alexander Dobin

unread,
Jun 5, 2017, 4:30:14 PM6/5/17
to rna-star
Hi Pai,

the first job that you run with the --genomeLoad LoadAndKeep will load the genome into shared memory. The other jobs will wait for the loading to complete, and then will start using the genome.
So the loading part is pretty much automatic. However, unloading is not automatic - you would need to run --genomeLoad Remove after your jobs are finished.

I am not sure about the docker container - I have not done it myself. I think you should be able to put the genome file into the image (though it's going to be very big).
However, you would need to specify a physical directory for the genome, as STAR uses it to distinguish the genomes in the shared memory.

Cheers
Alex

Cole Wunderlich

unread,
Apr 26, 2019, 12:00:42 PM4/26/19
to rna-star
I had a similar question myself.  It is not clear to me whether you only need to run a job with --genomeLoad LoadAndKeep once, and then all subsequent jobs do NOT need --genomeLoad or --genomeDir,  or if every job needs to have both --genomeLoad LoadAndKeep AND --genomeDir specified.

Alexander Dobin

unread,
Apr 26, 2019, 12:50:09 PM4/26/19
to rna-star
Hi Cole,

all jobs have to have  --genomeLoad LoadAndKeep and  --genomeDir /.../...
so that each job knows to look for the genome in shared memory (and load it it's not there) and which genome to use.

Cheers
Alex

Cole Wunderlich

unread,
May 1, 2019, 9:56:18 PM5/1/19
to rna-star
Thanks, that clears things up!

Cole
Reply all
Reply to author
Forward
0 new messages