Skip to content

Error propagation in free_fn callback for generalized requests #11681

Open
@dalcinl

Description

@dalcinl

This is with branch v5.0.x, but I guess main has the same issue (currently, I'm unable to build main with internal pmix on Fedora 38, I'll submit another issue).

Reproducer

#include <stddef.h>
#include <mpi.h>

static int query_fn  (void *ctx, MPI_Status *s) { return MPI_SUCCESS; }
static int free_fn   (void *ctx) { return MPI_ERR_OTHER; }  // <-- RETURN WITH FAILURE !!!
static int cancel_fn (void *ctx, int c) { return MPI_SUCCESS;   }

int main(int argc, char *argv[])
{
  MPI_Request request;
  MPI_Init(&argc, &argv);
  MPI_Grequest_start(query_fn, free_fn, cancel_fn, NULL, &request);

  MPI_Grequest_complete(request);
  MPI_Wait(&request, MPI_STATUS_IGNORE);

  MPI_Finalize();
  return 0;
}

Expected behavior

The reproducer should abort (via default error handler).

Actual behavior

The reproducer runs to completion with success and no output.
The error code from free_fn is not propagated to MPI_Wait as required by the MPI standard.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions