2015-11-26 23:18 GMT+03:00 Martijn Slouter <martijnslou...@gmail.com>:
> Hello,
> I am looking for a solution for a tomcat container, which is supposed to
> serve a web application, which is using MPI (openmpi) internally. (The
> servlet is making JNI calls to C library functions. I have validated that
> this Java-MPI connection runs without problems when NOT using tomcat.)
>
> In catalina.sh, I have changed the lines which actually starts tomcat
>   eval "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER ...
> into the same command preceded by mpirun:
>   eval mpirun -n 2 "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER
> ...
>
> However, in catalina.out I get errors like
>   "... java.net.BindException: Address already in use ..."
> This makes sense, because both MPI processes will try to bind to the same
> address.
>
> Is there any chance to have tomcat serve a web application which is using
> native MPI functions inside one of its servlets?
>
> I am using apache-tomcat-7.0.65 on Ubuntu 15.04.

What is your goal, your expectation of Tomcat? What these n instances
should do that 1 instance cannot?

Is is possible to start several Tomcats with the same CATALINA_BASE in
parallel, but you have to
1. Disable shutdown port (set port="-1" on <Server> element if I
remember correctly)

It means that these Tomcats have to shut themselves down eventually
(like explicitly calling System.exit()), or you have to kill them by
sending a signal (knowing pid of the process).

2. Remove connectors, or disable them (port="-1" if I remember
correctly), or configure them to autoselect a random port number
(port="0" if I remember correctly)

A connector can be configured, reconfigured, started/stopped
programmatically via JMX.

3. Do not perform any writing activity in CATALINA_BASE

- Do not deploy war files (so that Tomcat does not need to unpack them)
- Do not deploy any new applications while Tomcat is running. Turn off
autoDeploy feature on Host. Do not use Tomcat Manager web application.

- Do not compile JSP pages. Turn them into servlets by precompiling
them with Jasper JspC.

- Do not write serialized session data (configure <Manager> with pathname="").

- Turn off logging (or turn a deaf ear to it trying to concurrently
write into the same log files).


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to