|
| 1 | +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ |
| 2 | +/* |
| 3 | + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana |
| 4 | + * University Research and Technology |
| 5 | + * Corporation. All rights reserved. |
| 6 | + * Copyright (c) 2004-2020 The University of Tennessee and The University |
| 7 | + * of Tennessee Research Foundation. All rights |
| 8 | + * reserved. |
| 9 | + * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, |
| 10 | + * University of Stuttgart. All rights reserved. |
| 11 | + * Copyright (c) 2004-2005 The Regents of the University of California. |
| 12 | + * All rights reserved. |
| 13 | + * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. |
| 14 | + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights |
| 15 | + * reserved. |
| 16 | + * Copyright (c) 2015 Research Organization for Information Science |
| 17 | + * and Technology (RIST). All rights reserved. |
| 18 | + * Copyright (c) 2024 Triad National Security, LLC. All rights |
| 19 | + * reserved. |
| 20 | + * $COPYRIGHT$ |
| 21 | + * |
| 22 | + * Additional copyrights may follow |
| 23 | + * |
| 24 | + * $HEADER$ |
| 25 | + */ |
| 26 | +#include "ompi_config.h" |
| 27 | +#include <stdio.h> |
| 28 | + |
| 29 | +#include "ompi/mpi/c/bindings.h" |
| 30 | +#include "ompi/runtime/params.h" |
| 31 | +#include "ompi/communicator/communicator.h" |
| 32 | +#include "ompi/errhandler/errhandler.h" |
| 33 | +#include "ompi/win/win.h" |
| 34 | +#include "ompi/mca/osc/osc.h" |
| 35 | +#include "ompi/datatype/ompi_datatype.h" |
| 36 | +#include "ompi/runtime/ompi_spc.h" |
| 37 | + |
| 38 | +PROTOTYPE ERROR_CLASS put_with_notify(BUFFER origin_addr, COUNT origin_count, DATATYPE origin_datatype, |
| 39 | + INT target_rank, AINT target_disp, COUNT target_count, |
| 40 | + DATATYPE target_datatype, INT notification_idx, WIN win) |
| 41 | +{ |
| 42 | + int rc; |
| 43 | + |
| 44 | + SPC_RECORD(OMPI_SPC_PUT_WITH_NOTIFY, 1); |
| 45 | + |
| 46 | + if (MPI_PARAM_CHECK) { |
| 47 | + rc = OMPI_SUCCESS; |
| 48 | + |
| 49 | + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); |
| 50 | + |
| 51 | + if (ompi_win_invalid(win)) { |
| 52 | + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_WIN, FUNC_NAME); |
| 53 | + } else if (origin_count < 0 || target_count < 0) { |
| 54 | + rc = MPI_ERR_COUNT; |
| 55 | + } else if (ompi_win_peer_invalid(win, target_rank) && |
| 56 | + (MPI_PROC_NULL != target_rank)) { |
| 57 | + rc = MPI_ERR_RANK; |
| 58 | + } else if (NULL == target_datatype || |
| 59 | + MPI_DATATYPE_NULL == target_datatype) { |
| 60 | + rc = MPI_ERR_TYPE; |
| 61 | + } else if ( MPI_WIN_FLAVOR_DYNAMIC != win->w_flavor && target_disp < 0 ) { |
| 62 | + rc = MPI_ERR_DISP; |
| 63 | + } else if (notification_idx < 0) { |
| 64 | + rc = MPI_ERR_NOTIFY_IDX; |
| 65 | + } else { |
| 66 | + OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, origin_datatype, origin_count); |
| 67 | + if (OMPI_SUCCESS == rc) { |
| 68 | + OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, target_datatype, target_count); |
| 69 | + } |
| 70 | + } |
| 71 | + OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME); |
| 72 | + } |
| 73 | + |
| 74 | + if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS; |
| 75 | + |
| 76 | + rc = win->w_osc_module->osc_put_with_notify(origin_addr, origin_count, origin_datatype, |
| 77 | + target_rank, target_disp, target_count, |
| 78 | + target_datatype, notification_idx. win); |
| 79 | + OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME); |
| 80 | +} |
0 commit comments