[IPOL discuss] question about run_algo

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Wed Dec 8 15:03:55 CET 2010

> 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

Nicolas LIMARE
http://nicolas.limare.net/                         pgp:0xFA423F4F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20101208/d4f919da/attachment-0001.pgp>

More information about the discuss mailing list