Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] [OMPI svn] svn:open-mpi r21285
From: George Bosilca (bosilca_at_[hidden])
Date: 2009-05-27 11:42:54


Ralph,

This patch is not correct. First it adds a significant overhead in
terms of if in the critical path (3 more ifs per char in the output
stream), and second it will generate random segfaults.

The test for the orte_xml_output can be centralized in just one if,
reducing the overhead to one if per byte, or the whole loop can be
duplicated and the test can be done only once per message.

For the second problem, the correct solution is a little bit more
complex. One should check that k is small enough to replace one char
by 5 without overwriting after the end of the output buffer.

   Thanks,
     george.

On May 26, 2009, at 20:43 , rhc_at_[hidden] wrote:

> Author: rhc
> Date: 2009-05-26 20:43:54 EDT (Tue, 26 May 2009)
> New Revision: 21285
> URL: https://svn.open-mpi.org/trac/ompi/changeset/21285
>
> Log:
> Modify the xml output per devel-list discussion with Greg Watson
>
> Text files modified:
> trunk/orte/mca/iof/base/iof_base_output.c | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> Modified: trunk/orte/mca/iof/base/iof_base_output.c
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- trunk/orte/mca/iof/base/iof_base_output.c (original)
> +++ trunk/orte/mca/iof/base/iof_base_output.c 2009-05-26 20:43:54
> EDT (Tue, 26 May 2009)
> @@ -170,6 +170,19 @@
> output->data[k++] = starttag[j];
> }
> }
> + } else if (orte_xml_output && '&' == data[i]) {
> + output->data[k++] = '&';
> + output->data[k++] = 'a';
> + output->data[k++] = 'm';
> + output->data[k++] = 'p';
> + } else if (orte_xml_output && '<' == data[i]) {
> + output->data[k++] = '&';
> + output->data[k++] = 'l';
> + output->data[k++] = 't';
> + } else if (orte_xml_output && '>' == data[i]) {
> + output->data[k++] = '&';
> + output->data[k++] = 'g';
> + output->data[k++] = 't';
> } else {
> output->data[k++] = data[i];
> }
> _______________________________________________
> svn mailing list
> svn_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/svn