Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

From: Åke Sandgren (ake.sandgren_at_[hidden])
Date: 2007-10-24 08:17:20


On Wed, 2007-10-24 at 09:00 +0200, Åke Sandgren wrote:
> Hi!
>
> In common_mx.c the following looks wrong.
> ompi_common_mx_finalize(void)
> {
> mx_return_t mx_return;
> ompi_common_mx_initialize_ref_cnt--;
> if(ompi_common_mx_initialize == 0) {
>
> That should be
> if(ompi_common_mx_initialize_ref_cnt == 0)
> right?
>

And there was a missing return too.
Complete ompi_common_mx_finalize should be
int
ompi_common_mx_finalize(void)
{
    mx_return_t mx_return;
    ompi_common_mx_initialize_ref_cnt--;
    if(ompi_common_mx_initialize_ref_cnt == 0) {
        mx_return = mx_finalize();
        if(mx_return != MX_SUCCESS){
            opal_output(0, "Error in mx_finalize (error %s)\n",
mx_strerror(mx_return));
            return OMPI_ERROR;
        }
    }
    return OMPI_SUCCESS;
}