Skip to content
Snippets Groups Projects
Select Git revision
  • 2023 default protected
1 result

rma-get-attr.patch

Blame
    • Rémi Dehenne's avatar
      ac94102b
      Fix invalid arg type in MPI_Win_get_attr · ac94102b
      Rémi Dehenne authored
      The attribute_val argument of MPI_Win_get_attr was improperly set regarding
      to the MPI Standard.
      Prior to casting, the attribute_val argument must be an int** or void**.
      MPC assumed attribute_val to be an int* or void*, thus leading to
      unexpected behaviors in user applications.
      ac94102b
      History
      Fix invalid arg type in MPI_Win_get_attr
      Rémi Dehenne authored
      The attribute_val argument of MPI_Win_get_attr was improperly set regarding
      to the MPI Standard.
      Prior to casting, the attribute_val argument must be an int** or void**.
      MPC assumed attribute_val to be an int* or void*, thus leading to
      unexpected behaviors in user applications.
    rma-get-attr.patch 1.83 KiB
    From 831247ca5ab5589e42be0864bc3d1965b7cec914 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?R=C3=A9mi=20Dehenne?= <remi.dehenne@cea.fr>
    Date: Fri, 27 Oct 2023 18:44:31 +0200
    Subject: [PATCH] RMA: Fix invalid arg type in MPI_Win_get_attr
    
    The attribute_val argument of MPI_Win_get_attr was improperly set regarding
    to the MPI Standard.
    Prior to casting, the attribute_val argument must be an int** or void**.
    MPC assumed attribute_val to be an int* or void*, thus leading to
    unexpected behaviors in user applications.
    ---
     src/MPC_MPI/src/mpi_rma_win.c | 11 ++++-------
     1 file changed, 4 insertions(+), 7 deletions(-)
    
    diff --git a/src/MPC_MPI/src/mpi_rma_win.c b/src/MPC_MPI/src/mpi_rma_win.c
    index de22d11db..c02ba4d9c 100644
    --- a/src/MPC_MPI/src/mpi_rma_win.c
    +++ b/src/MPC_MPI/src/mpi_rma_win.c
    @@ -1163,7 +1163,6 @@ int mpc_MPI_Win_get_attr(MPI_Win win, int keyval, void *attr_val, int *flag)
     	}
     
     	struct mpc_lowcomm_rdma_window *low_win = sctk_win_translate(win);
    -	uintptr_t val;
     
     	/* First handle special values */
     	switch(keyval)
    @@ -1175,24 +1174,22 @@ int mpc_MPI_Win_get_attr(MPI_Win win, int keyval, void *attr_val, int *flag)
     
     		case MPI_WIN_SIZE:
     			*flag = 1;
    -			*( (void **)attr_val) = (void *)low_win->size;
    +			*( (void **)attr_val) = (void *)&low_win->size;
     			return MPI_SUCCESS;
     
     		case MPI_WIN_DISP_UNIT:
     			*flag = 1;
    -			*( (void **)attr_val) = (void *)low_win->disp_unit;
    +			*( (void **)attr_val) = (void *)&low_win->disp_unit;
     			return MPI_SUCCESS;
     
     		case MPI_WIN_CREATE_FLAVOR:
     			*flag = 1;
    -			val   = desc->flavor;
    -			*( (void **)attr_val) = (void *)val;
    +			*( (void **)attr_val) = (void *)&desc->flavor;
     			return MPI_SUCCESS;
     
     		case MPI_WIN_MODEL:
     			*flag = 1;
    -			val   = desc->model;
    -			*( (void **)attr_val) = (void *)val;
    +			*( (void **)attr_val) = (void *)&desc->model;
     			return MPI_SUCCESS;
     	}
     
    -- 
    2.34.1