# Logical processes remain active after my parallelized program ends

**URL:** <https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338>\
**Category:** Julia at Scale\
**Created:** [October 15, 2018, 10:51am UTC](https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338 "2018-10-15T10:51:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsHitman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dshitman/32/5465_2.png) [@dsHitman](https://discourse.julialang.org/u/dsHitman)\
**Post date:** [October 15, 2018, 10:51am UTC](https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338/1 "2018-10-15T10:51:07Z")

</div>

Hi, I have developed a parallel version of a cellular automata but when the programm ends the logical process continue to remain active as the programm didn’t ends. Why?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 15, 2018, 10:57am UTC](https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338/2 "2018-10-15T10:57:21Z")

</div>

Please share an MWE.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![dsHitman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dshitman/32/5465_2.png) [@dsHitman](https://discourse.julialang.org/u/dsHitman)\
**Post date:** [October 16, 2018, 9:35am UTC](https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338/3 "2018-10-16T09:35:19Z")

</div>

Sorry, I find the solution, I must use the @sync because I thought that the programm end but it didn’t ends. Thanks.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [October 16, 2018, 10:00am UTC](https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338/4 "2018-10-16T10:00:29Z")

</div>

@dsHitman I have built and managed HPC systems for a long time. This is a common problem - Matlab I am looking at you!  
I have not come across it with Julia and I would like to help.  
There are several ways to solve this problem:  
a) make sure the Julia job exits properly - of course  
b) a post job script is run for every job which cleans up orphaned processesw  
c) running in cgroups - which is actually what containers are - you run in a cgroup and cancel the cgroup at the end of the job. All processes are terminated.

Could you please tell us exactly how you are running - do you have a batch system such as PBS or Slurm?

Also do the following when a job is running and also when a job has finished,  
where username is your username

ssh into a compute node  
ps -eaf --forest | grep username

Thanks

---

<div class="post-metadata">

**Author:** ![dsHitman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dshitman/32/5465_2.png) [@dsHitman](https://discourse.julialang.org/u/dsHitman)\
**Post date:** [October 16, 2018, 10:06am UTC](https://discourse.julialang.org/t/logical-processes-remain-active-after-my-parallelized-program-ends/16338/5 "2018-10-16T10:06:45Z")

</div>

Thanks for the answer but, as I write before, I find the solution using the @sync macro. Thanks again for the interest.
