Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21565 > unrolled thread

Re: concatenate function

Started byRobert Kern <robert.kern@gmail.com>
First post2012-03-13 15:02 +0000
Last post2012-03-13 15:02 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: concatenate function Robert Kern <robert.kern@gmail.com> - 2012-03-13 15:02 +0000

#21565 — Re: concatenate function

FromRobert Kern <robert.kern@gmail.com>
Date2012-03-13 15:02 +0000
SubjectRe: concatenate function
Message-ID<mailman.614.1331650948.3037.python-list@python.org>
On 3/13/12 2:35 PM, ferreirafm wrote:
> Hi List,
> I've coded three functions that I would like to concatenate. I mean, run
> them one after another. The third function depends on the results of the
> second function, which depends on the results of the first one. When I call
> one function after another, python runs them at the same time causing
> obvious errors messages. I've tried to call one of them from inside another
> but no way. Any clues are appreciated.
> Complete code goes here:
> http://ompldr.org/vZDB4OQ

Just to clarify, the Python functions are indeed running consecutively, not 
concurrently. Your Python functions write scripts and then use subprocess.call() 
to make qsub (an external program) to submit those scripts to a job queue. What 
you are calling a "function" in your post are these scripts. Please don't call 
them "functions". It's confusing.

Python is not running these scripts concurrently. Your job queue is. 
subprocess.call() will wait until qsub returns. However, qsub just submits the 
script to the job queue; it does not wait until the job is completed. Most 
qsub-using job queues can be set up to make jobs depend on the completion of 
other jobs. You will need to read the documentation of your job queue to figure 
out how to do this. Once you figure out the right arguments to give to qsub, 
your Python code is already more or less correct.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web