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: Ralph Castain (rhc_at_[hidden])
Date: 2009-05-27 20:06:28


First, this is in the code path where mpirun outputs to stdout/stderr.
Hardly a "critical path". :-)

Second, I know about the overwrite problem, but wanted to first see if this
met Greg's needs. If you look, you will see that the overwrite problem has
-always- been there in the code, but we didn't worry about it because only
Greg's team was using the xml code, and only in test mode.

Now that we are settling on a solution, we can spend the extra cycles to
make it a tad more robust... :-)

On Wed, May 27, 2009 at 9:42 AM, George Bosilca <bosilca_at_[hidden]>wrote:

> 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
>>
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel
>