# Never ending execution

**URL:** <https://root-forum.cern.ch/t/never-ending-execution/40950>\
**Category:** Garfield++\
**Created:** [August 11, 2020, 2:29pm UTC](https://root-forum.cern.ch/t/never-ending-execution/40950 "2020-08-11T14:29:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Christian](https://root-forum.cern.ch/u/Christian)\
**Post date:** [August 11, 2020, 2:29pm UTC](https://root-forum.cern.ch/t/never-ending-execution/40950/1 "2020-08-11T14:29:28Z")

</div>

Hi!

Since I couldn’t find any topic here on this subject I’m going to create one.  
Everytime my code ends running, my terminal keeps stuck at this never ending/doing nothing mode. So whenever my program finishes execution, I need to close the terminal and open another if I want to run other stuff.  
I tried to run all the examples that come with Garfield++ instalation, and for all of them it happens the same.

So, if my program works at the end of the day, why boder with that?  
Well, I need to run hundred of simulations in a cluster at the same time, and when one of the simulation is done, I submit another. But as I explained, despite my program already did what it should do, it still keeps running, and this way, my simulation never ends at the cluster.  
(Actually it ends with time exceeded error)  
Does anyone has any ideia of how to overcome that problem?

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [August 11, 2020, 2:32pm UTC](https://root-forum.cern.ch/t/never-ending-execution/40950/2 "2020-08-11T14:32:38Z")

</div>

Hi Christian,

can you maybe post a small reproducer along with some instructions on how to run it?

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [August 11, 2020, 7:31pm UTC](https://root-forum.cern.ch/t/never-ending-execution/40950/3 "2020-08-11T19:31:27Z")

</div>

Hi,  
I think what you refer to is more a feature than a bug. Most of the examples call the `Run()` method of a `TApplication` object to display the plots/histograms produced by the program. If you comment out this line the program should terminate normally. If you don’t need to display the canvas(es) you could also add a line `gROOT->SetBatch();`.

---

<div class="post-metadata">

**Author:** ![Christian](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Christian](https://root-forum.cern.ch/u/Christian)\
**Post date:** [August 12, 2020, 5:25pm UTC](https://root-forum.cern.ch/t/never-ending-execution/40950/4 "2020-08-12T17:25:28Z")

</div>

Well, that solved my problem! Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 26, 2020, 5:25pm UTC](https://root-forum.cern.ch/t/never-ending-execution/40950/5 "2020-08-26T17:25:39Z")

</div>

Closed on August 26, 2020, 5:25pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
