# Right way to run external program in parallel?

**URL:** https://discourse.julialang.org/t/right-way-to-run-external-program-in-parallel/109490
**Category:** New to Julia
**Tags:** parallel, filesystem, run, io
**Created:** [January 31, 2024, 3:49am UTC](https://discourse.julialang.org/t/right-way-to-run-external-program-in-parallel/109490 "2024-01-31T03:49:00Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Tetrakai](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)
#### Post date: [January 31, 2024, 4:21am UTC](https://discourse.julialang.org/t/right-way-to-run-external-program-in-parallel/109490/4 "2024-01-31T04:21:21Z")

</div>

Its essentially the innerloop of my simulation. You can get some idea from my earlier question here:

> [@What is the right way to store/record the results of this nested simulation?](https://discourse.julialang.org/t/what-is-the-right-way-to-store-record-the-results-of-this-nested-simulation/107639):
>
> I wrote this after seeing the responses to [my last question](https://discourse.julialang.org/t/how-to-best-preallocate-nested-tuples-of-dataframes-to-store-simulation-results/107543/33). From the responses I can tell my problem was not understood. What this simulation does is play a rudimentary “game” between pairs of two teams once per “week” and record the player results and league standings. Since the outcome is stochastic this is repeated multiple times. In actuality, the ratings/parameters of the players would change each simulation step and the output would be compared to other stats, but I left that out for no…

Essentially I am running a stochastic game engine in parallel (ie, simultaneous games each week, multiple replications of each season), comparing the results to a baseline, modifying the skill ratings of the players… repeat until the combination of ratings produce “realistic” results.

But I think you are right that perhaps I can use GNU parallel for part of this. Eg: [File I/O in gnu parallel - Stack Overflow](https://stackoverflow.com/questions/19952211/file-i-o-in-gnu-parallel)

---

_[View the full topic](https://discourse.julialang.org/t/right-way-to-run-external-program-in-parallel/109490)._
