[IPOL discuss] question about run_algo

Juan Cardelino juanc at fing.edu.uy
Thu Dec 9 10:45:45 CET 2010

I found the error. Thanks, it was just a typo in the executable name
(qmn->qmn) hard to see really.

I'm still thinking about using optional libraries (not many) mainly
for extra visualization. Would it be too crazy to have a part of the
demo that could 'safely' fail if that library is not present?
For example, my algorithm optionally outputs a  tree or a region
adjacency graph which is saved as a file on disk. Is really
straightforward and nice to render them as a graph using graphviz. I
thinking about:


On Wed, Dec 8, 2010 at 12:03 PM, Nicolas Limare
<nicolas.limare at cmla.ens-cachan.fr> wrote:
>> I've created one demo and make it run succesfully, however since
>> yesterday I'm having some problems to run my 2nd demo. I'm getting a
>> file not found error, but I can' tell if the problem is to find the
>> executable or the log file.
>> I have a little doubt: the path used by the demo, contains only the
>> bin/ subdir or the full path of the system?
> When running self.run_proc(), the PATH environment variable of the
> newly created subprocess only contains the /app/<demo_id>/bin
> directory, to avoid any name conflict (happened with a program called
> "size", for example).
> So, if you want to use a program provided by the system (which you
> should try to avoid, but I know sometimes it's the only reasonable
> option), you must use its full path, /usr/share/bin/foo
>> I've double checked that the executable (qnm) is in place and
>> runs from the command line. Below is the code of the run_algo function
>> and the output.
>> Thanks.
>> ------------- CODE -------------
>>  def run_algo(self, a, b):
>>       stdout_abs_filename = self.work_dir + self.stdout_rel_name
>>         stdout_file = open(stdout_abs_filename, 'w')
>>       p1 = self.run_proc(['qmn','main_ms_tree_vec_demo',
>> str(a),str(1),'input_0.png', 'output.tr', 'init_part.part'],
>> stdout=stdout_file, stderr=stdout_file)
> This run_proc is equivalent to these commands:
> $ cd /path/to/<app_id>/tmp/<key>
> $ PATH=../../bin qmn main_ms_tree_vec_demo <a> 1 input_0.png \
>      output.tr init_part.part
> Cold you try it from your shell? Does it work? If not, what is the
> message?
> --
> Nicolas LIMARE
> http://nicolas.limare.net/                         pgp:0xFA423F4F
> Version: GnuPG v1.4.10 (GNU/Linux)
> iEYEARECAAYFAkz/kEsACgkQvviFAPpCP0+jowCgmIfowTFOaj+5nyDL6tZr74fW
> x8sAnRVzqfyXLWU56pzLQTIMZWKgi4Ai
> =j3X1
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss

More information about the discuss mailing list