[mpich-discuss] Calling MPI from a CGI Python script

Nicolas Rosner nrosner at gmail.com
Thu Apr 29 02:07:32 CDT 2010


Hello,

It sounds reasonable for mpiexec to work when you run it interactively
but to fails when httpd runs it instead. cgi scripts are quite exposed
and often easily hacked through. Under most circumstances (think
defaults) you wouldn't want apache running your "contact us" form
handler with anywhere near the kinds of privileges and environment
that your trusted users, e.g. "esrujan", enjoy when they log on to
your system.

Thus, cgi scripts are usually run as a user called "nobody", "www" or
so, quite possibly with strong resource usage limits (on such stuff as
the max number of subprocesses it may spawn, cpu time it may use,
whether confined to a chroot jail, etc). Try making your script create
a file (run "echo foo >/tmp/test.txt", or "touch test.empty") and
check who owns it.

The good news is you don't need any fancy privileges to mpiexec
something on a single machine, but you do need a number of
environment-related adjustments. For instance, user "nobody" probably
does not have its PATH and other variables properly configured for
this, etc.

Good luck,
Nicolás


More information about the mpich-discuss mailing list