}
}
-int Request::match_recv(void* a, void* b, smx_activity_t ignored) {
+int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl* ignored)
+{
MPI_Request ref = static_cast<MPI_Request>(a);
MPI_Request req = static_cast<MPI_Request>(b);
XBT_DEBUG("Trying to match a recv of src %d against %d, tag %d against %d",ref->src_,req->src_, ref->tag_, req->tag_);
}else return 0;
}
-int Request::match_send(void* a, void* b,smx_activity_t ignored) {
+int Request::match_send(void* a, void* b, simgrid::kernel::activity::CommImpl* ignored)
+{
MPI_Request ref = static_cast<MPI_Request>(a);
MPI_Request req = static_cast<MPI_Request>(b);
XBT_DEBUG("Trying to match a send of src %d against %d, tag %d against %d",ref->src_,req->src_, ref->tag_, req->tag_);
int Request::waitany(int count, MPI_Request requests[], MPI_Status * status)
{
s_xbt_dynar_t comms; // Keep it on stack to save some extra mallocs
- int size = 0;
int index = MPI_UNDEFINED;
if(count > 0) {
+ int size = 0;
// Wait for a request to complete
xbt_dynar_init(&comms, sizeof(smx_activity_t), [](void*ptr){
intrusive_ptr_release(*(simgrid::kernel::activity::ActivityImpl**)ptr);
int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Status status[])
{
- int i;
int count = 0;
- int index;
MPI_Status stat;
MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
- for(i = 0; i < incount; i++)
- {
- index=waitany(incount, requests, pstat);
+ for (int i = 0; i < incount; i++) {
+ int index = waitany(incount, requests, pstat);
if(index!=MPI_UNDEFINED){
indices[count] = index;
count++;
}
void Request::free_f(int id) {
- char key[KEY_SIZE];
- if(id!=MPI_FORTRAN_REQUEST_NULL)
+ if (id != MPI_FORTRAN_REQUEST_NULL) {
+ char key[KEY_SIZE];
xbt_dict_remove(F2C::f2c_lookup(), get_key_id(key, id));
+ }
}
}