X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/237fd22b56db7d1c67360c37559ce3aab16a002d..5ed37babb2fa9097abe82df299c0aa259ed84d5a:/src/smpi/bindings/smpi_pmpi_win.cpp diff --git a/src/smpi/bindings/smpi_pmpi_win.cpp b/src/smpi/bindings/smpi_pmpi_win.cpp index 014cb17930..a125ec9b0f 100644 --- a/src/smpi/bindings/smpi_pmpi_win.cpp +++ b/src/smpi/bindings/smpi_pmpi_win.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -30,8 +30,10 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi); int PMPI_Win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win){ int retval = 0; CHECK_COMM(5) + CHECK_BUFFER(1, base, size, MPI_BYTE) CHECK_NEGATIVE(2, MPI_ERR_OTHER, size) CHECK_NEGATIVE(3, MPI_ERR_OTHER, disp_unit) + CHECK_COLLECTIVE(comm, __func__) const SmpiBenchGuard suspend_bench; if (base == nullptr && size != 0){ retval= MPI_ERR_OTHER; @@ -99,12 +101,14 @@ int PMPI_Win_detach(MPI_Win win, const void* base) int PMPI_Win_free( MPI_Win* win){ CHECK_NULL(1, MPI_ERR_WIN, win) CHECK_WIN(1, (*win)) + CHECK_COLLECTIVE((*win)->comm(), __func__) if (_smpi_cfg_pedantic && (*win)->opened() == 1){//only check in pedantic mode, as it's not clear this is illegal XBT_WARN("Attempt to destroy a MPI_Win too early -missing MPI_Win_fence ?"); return MPI_ERR_WIN; } const SmpiBenchGuard suspend_bench; - delete *win; + simgrid::smpi::Win::del(*win); + *win = MPI_WIN_NULL; return MPI_SUCCESS; } @@ -175,7 +179,7 @@ int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, retval = win->get( origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype); TRACE_smpi_comm_out(my_proc_id); - + return retval; }