I am trying to run a python script which processes many FASTA files in parallel using GNU parallel 20110722. As it could be seen below, I am not able to run in any of the ways I tried.
(^C
marks the point where I interrupt the job with ctrl+C because there is no response from the system).
me@kubuntu:~/Programs/LeitMotifsParallel$ parallel python {1} :::: <(echo MainMult.18136.py)
^C
me@kubuntu:~/Programs/LeitMotifsParallel$ parallel python {1} ::: <(echo MainMult.18136.py)
File "/dev/fd/63", line 1
MainMult.18136.py
^
SyntaxError: invalid syntax
me@kubuntu:~/Programs/LeitMotifsParallel$ parallel MainMult.18136.py
parallel: Input is tty. Press CTRL-D to exit.
^C
me@kubuntu:~/Programs/LeitMotifsParallel$
However, the python script runs as expected when run directly from console.
me@kubuntu:~/Programs/LeitMotifsParallel$ MainMult.18136.py
/home/me/Programs/LeitMotifsParallel/StAlg.py:6: DeprecationWarning: the sets module is deprecated
import sets #@UnusedImport
Start : 18:59:34 11Aug2011
['M']
['M']
(...)
Though I have watched the two tutorials on GNU Parallel in youtube and have gone through the many examples of the README file, I haven't been succesful in finding an answer for this situation, so I would really appreciate if you could help me solve this.
Note that you can also use threading really easily from within Python: http://docs.python.org/library/multiprocessing.html
Not sure this is a bioinformatics question. What are the ":::" doing? did you try "parallel python -- your-prog.py"
Is it possible/necessary to put the python call into a separate bash file (e.g. run.sh)? It might be a problem with the input/output redirection or piping...
Thanks all for the suggestions. Though I don't think it could be strictly categorized as a bioinformatics question I assumed it may be relevant for the community.
brentp: The ":::" are used by GNU Parallel for specifying arguments from the command line. I tried with your option but the "Input from tty" line shows it is not useful.
cjt: I tried with calling python from a separate bash file and using parallel to call that file but it is not working either.
Michael Schubert: I would definitely use threading from within Python in other cases but for this job I need to use parallel.