-/* Copyright (c) 2007-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2017. 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. */
-#include "private.h"
-#include <vector>
+#include "src/smpi/private.h"
+#include "src/smpi/smpi_coll.hpp"
+#include "src/smpi/smpi_comm.hpp"
+#include "src/smpi/smpi_datatype.hpp"
+#include "src/smpi/smpi_info.hpp"
+#include "src/smpi/smpi_keyvals.hpp"
+#include "src/smpi/smpi_process.hpp"
+#include "src/smpi/smpi_request.hpp"
+#include "src/smpi/smpi_win.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_rma, smpi, "Logging specific to SMPI (RMA operations)");
}
int Win::lock(int lock_type, int rank, int assert){
- if(opened_!=0)
- return MPI_ERR_WIN;
-
MPI_Win target_win = connected_wins_[rank];
if ((lock_type == MPI_LOCK_EXCLUSIVE && target_win->mode_ != MPI_LOCK_SHARED)|| target_win->mode_ == MPI_LOCK_EXCLUSIVE){
target_win->lockers_.push_back(comm_->rank());
- int finished = finish_comms();
+ int finished = finish_comms(rank);
XBT_DEBUG("Win_lock %d - Finished %d RMA calls", rank, finished);
-
+ finished = target_win->finish_comms(rank_);
+ XBT_DEBUG("Win_lock target %d - Finished %d RMA calls", rank, finished);
return MPI_SUCCESS;
}
}
int Win::unlock(int rank){
- if(opened_!=0)
- return MPI_ERR_WIN;
-
MPI_Win target_win = connected_wins_[rank];
int target_mode = target_win->mode_;
target_win->mode_= 0;
xbt_mutex_release(target_win->lock_mut_);
}
- int finished = finish_comms();
+ int finished = finish_comms(rank);
XBT_DEBUG("Win_unlock %d - Finished %d RMA calls", rank, finished);
-
+ finished = target_win->finish_comms(rank_);
+ XBT_DEBUG("Win_unlock target %d - Finished %d RMA calls", rank, finished);
return MPI_SUCCESS;
}
std::vector<MPI_Request>* myreqqs = new std::vector<MPI_Request>();
std::vector<MPI_Request>::iterator iter = reqqs->begin();
while (iter != reqqs->end()){
- if(((*iter)->src() == rank) || ((*iter)->dst() == rank)){
+ if(((*iter)!=MPI_REQUEST_NULL) && (((*iter)->src() == rank) || ((*iter)->dst() == rank))){
myreqqs->push_back(*iter);
iter = reqqs->erase(iter);
size++;