There might be problem to use exit here if the FEM calculation is running under GUI (mostly for  demonstration purpose). I do not whether your guys to plan to add MPI computation in GUI for demonstration.