#include "surf/surf.h"
#include "simgrid/sg_config.h"
#include "smpi/smpi_utils.hpp"
+#include "src/smpi/smpi_group.hpp"
#include "colls/colls.h"
#include <simgrid/s4u/host.hpp>
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag, comm, PERSISTENT | SEND | PREPARED);
+ smpi_comm_group(comm)->index(dst), tag, comm, PERSISTENT | SEND | PREPARED);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag, comm, PERSISTENT | SSEND | SEND | PREPARED);
+ smpi_comm_group(comm)->index(dst), tag, comm, PERSISTENT | SSEND | SEND | PREPARED);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype,
- src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src),
+ src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_comm_group(comm)->index(src),
smpi_process_index(), tag, comm, PERSISTENT | RECV | PREPARED);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf , count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag,comm, PERSISTENT | ISEND | SEND | PREPARED);
+ smpi_comm_group(comm)->index(dst), tag,comm, PERSISTENT | ISEND | SEND | PREPARED);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag, comm, NON_PERSISTENT | ISEND | SEND);
+ smpi_comm_group(comm)->index(dst), tag, comm, NON_PERSISTENT | ISEND | SEND);
smpi_mpi_start(request);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag,comm, NON_PERSISTENT | ISEND | SSEND | SEND);
+ smpi_comm_group(comm)->index(dst), tag,comm, NON_PERSISTENT | ISEND | SSEND | SEND);
smpi_mpi_start(request);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
- smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
+ smpi_comm_group(comm)->index(src), smpi_process_index(), tag,
comm, PERSISTENT | RECV | PREPARED);
return request;
}
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
- smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag, comm,
+ smpi_comm_group(comm)->index(src), smpi_process_index(), tag, comm,
NON_PERSISTENT | RECV);
smpi_mpi_start(request);
return request;
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag, comm, NON_PERSISTENT | SEND);
+ smpi_comm_group(comm)->index(dst), tag, comm, NON_PERSISTENT | SEND);
smpi_mpi_start(request);
smpi_mpi_wait(&request, MPI_STATUS_IGNORE);
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = build_request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, smpi_process_index(),
- smpi_group_index(smpi_comm_group(comm), dst), tag, comm, NON_PERSISTENT | SSEND | SEND);
+ smpi_comm_group(comm)->index(dst), tag, comm, NON_PERSISTENT | SSEND | SEND);
smpi_mpi_start(request);
smpi_mpi_wait(&request, MPI_STATUS_IGNORE);
MPI_Request requests[2];
MPI_Status stats[2];
int myid=smpi_process_index();
- if ((smpi_group_index(smpi_comm_group(comm), dst) == myid) && (smpi_group_index(smpi_comm_group(comm), src) == myid)){
+ if ((smpi_comm_group(comm)->index(dst) == myid) && (smpi_comm_group(comm)->index(src) == myid)){
smpi_datatype_copy(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype);
return;
}
if(!((req->detached != 0) && ((req->flags & SEND) != 0)) && ((req->flags & PREPARED) == 0)){
if(status != MPI_STATUS_IGNORE) {
int src = req->src == MPI_ANY_SOURCE ? req->real_src : req->src;
- status->MPI_SOURCE = smpi_group_rank(smpi_comm_group(req->comm), src);
+ status->MPI_SOURCE = smpi_comm_group(req->comm)->rank(src);
status->MPI_TAG = req->tag == MPI_ANY_TAG ? req->real_tag : req->tag;
status->MPI_ERROR = req->truncated != 0 ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
// this handles the case were size in receive differs from size in send
void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status){
MPI_Request request = build_request(nullptr, 0, MPI_CHAR, source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
- smpi_group_index(smpi_comm_group(comm), source), smpi_comm_rank(comm), tag, comm, PERSISTENT | RECV);
+ smpi_comm_group(comm)->index(source), smpi_comm_rank(comm), tag, comm, PERSISTENT | RECV);
// to avoid deadlock, we have to sleep some time here, or the timer won't advance and we will only do iprobe simcalls
// (especially when used as a break condition, such as while(MPI_Iprobe(...)) ... )
MPI_Request req = static_cast<MPI_Request>(sync_comm->src_data);
*flag = 1;
if(status != MPI_STATUS_IGNORE && (req->flags & PREPARED) == 0) {
- status->MPI_SOURCE = smpi_group_rank(smpi_comm_group(comm), req->src);
+ status->MPI_SOURCE = smpi_comm_group(comm)->rank(req->src);
status->MPI_TAG = req->tag;
status->MPI_ERROR = MPI_SUCCESS;
status->count = req->real_size;