Q:

How run a python program faster using GNU parallel?

I have a python program which can be executed using multiple threads, however, it fails (segmentation fault, core dumped) when using more than 1 thread.
What I was thinking of an alternate possibility to run script using GNU parallel. I am very new to this and have limited knowledge about the same. Any help would be appreciated.

A:

Say you have example.py and you want to run it N times. You can run the following
seq 10 | parallel -N0 --jobs 0 example.py

Breaking this down seq 10 will cause 10 jobs to be run. The -N0 flag tells us to ignore the input which would normally read in the input output by the seq 10 command. --jobs 0 will let as many run in parallel as you want.
As far as I know parallel doesn't let you say run this program X times with no input so you must abuse piping into the command with seq and then ignoring it with the -N0 flag.
Read this for further examples on commands: https://www.gnu.org/software/parallel/man.html

