# Running multiple CLIs at once

**URL:** https://discourse.slicer.org/t/running-multiple-clis-at-once/7686
**Category:** Support
**Created:** [July 19, 2019, 3:53pm UTC](https://discourse.slicer.org/t/running-multiple-clis-at-once/7686 "2019-07-19T15:53:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [July 19, 2019, 3:53pm UTC](https://discourse.slicer.org/t/running-multiple-clis-at-once/7686/1 "2019-07-19T15:53:18Z")

</div>

I was testing running some CLIs at the same time. I was using `slicer.cli.run()` calls back to back and it is calling a python CLI. However, the second cli run call stays in “Scheduled” status state until the first run call finishes.

Is it possible or some setting I’m missing to make these two run at the same time?

CPU processing was no where near getting maxed out during this time so I’d like to take advantage of more processing power since these two calls are processing independent data.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [July 19, 2019, 6:18pm UTC](https://discourse.slicer.org/t/running-multiple-clis-at-once/7686/2 "2019-07-19T18:18:21Z")

</div>

I should’ve probably specified that I’m using a Slicer nightly build which is about 10 days old.

The behavior is as though I’m specifying `wait_for_completion=True` argument even though I’m using the default of “False”.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 19, 2019, 6:46pm UTC](https://discourse.slicer.org/t/running-multiple-clis-at-once/7686/3 "2019-07-19T18:46:15Z")

</div>

I think there is a single processing thread in vtkSlicerApplicationLogic, which maintains a task queue and executes them one by one. It would probably not too difficult to change the application logic to run multiple tasks at once. If we wanted to make things optimal then the application logic would need to analyze dependencies between CLIs (since you can auto-run CLIs that use outputs of other CLI as inputs), but this is not essential.

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [December 8, 2022, 3:28am UTC](https://discourse.slicer.org/t/running-multiple-clis-at-once/7686/4 "2022-12-08T03:28:12Z")

</div>

To follow up, support for running multiple CLIs in parallel is proposed in [PR-6723](https://github.com/Slicer/Slicer/pull/6723).
