MPI_Comm comm)
{
int src, dst, comm_size, rank;
- comm_size = smpi_comm_size(comm);
+ comm_size = comm->size();
- if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
- smpi_comm_init_smp(comm);
+ if(comm->get_leaders_comm()==MPI_COMM_NULL){
+ comm->init_smp();
}
int num_core=1;
- if (smpi_comm_is_uniform(comm)){
- num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ if (comm->is_uniform()){
+ num_core = comm->get_intra_comm()->size();
}
if(comm_size%num_core)
THROWF(arg_error,0, "allgather SMP simple algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ", num_core);
- rank = smpi_comm_rank(comm);
+ rank = comm->rank();
MPI_Aint rextent, sextent;
- rextent = smpi_datatype_get_extent(rtype);
- sextent = smpi_datatype_get_extent(stype);
+ rextent = rtype->get_extent();
+ sextent = stype->get_extent();
int tag = COLL_TAG_ALLGATHER;
MPI_Status status;
int i, send_offset, recv_offset;
}
//INTRA-SMP-ALLGATHER
recv_offset = rank * rextent * rcount;
- smpi_mpi_sendrecv(send_buf, scount, stype, rank, tag,
+ Request::sendrecv(send_buf, scount, stype, rank, tag,
((char *) recv_buf + recv_offset), rcount, rtype, rank, tag,
comm, &status);
for (i = 1; i < num_core_in_current_smp; i++) {
(num_core_in_current_smp);
recv_offset = src * rextent * rcount;
- smpi_mpi_sendrecv(send_buf, scount, stype, dst, tag,
+ Request::sendrecv(send_buf, scount, stype, dst, tag,
((char *) recv_buf + recv_offset), rcount, rtype, src, tag,
comm, &status);
src = ((inter_rank - i + inter_comm_size) % inter_comm_size) * num_core;
//send_offset = (rank * sextent * scount);
recv_offset = (src * sextent * scount);
- // smpi_mpi_sendrecv((recv_buf+send_offset), (scount * num_core), stype, dst, tag,
+ // Request::sendrecv((recv_buf+send_offset), (scount * num_core), stype, dst, tag,
// (recv_buf+recv_offset), (rcount * num_core), rtype, src, tag, comm, &status);
//MPIC_Isend((recv_buf+send_offset), (scount * num_core), stype, dst, tag, comm, req_ptr++);
- *(req_ptr++) = smpi_mpi_irecv(((char *) recv_buf + recv_offset), (rcount * num_core), rtype,
+ *(req_ptr++) = Request::irecv(((char *) recv_buf + recv_offset), (rcount * num_core), rtype,
src, tag, comm);
}
for (i = 1; i < inter_comm_size; i++) {
//src = ((inter_rank-i+inter_comm_size)%inter_comm_size) * num_core;
send_offset = (rank * sextent * scount);
//recv_offset = (src * sextent * scount);
- // smpi_mpi_sendrecv((recv_buf+send_offset), (scount * num_core), stype, dst, tag,
+ // Request::sendrecv((recv_buf+send_offset), (scount * num_core), stype, dst, tag,
// (recv_buf+recv_offset), (rcount * num_core), rtype, src, tag, comm, &status);
- *(req_ptr++) = smpi_mpi_isend(((char *) recv_buf + send_offset), (scount * num_core), stype,
+ *(req_ptr++) = Request::isend(((char *) recv_buf + send_offset), (scount * num_core), stype,
dst, tag, comm);
//MPIC_Irecv((recv_buf+recv_offset), (rcount * num_core), rtype, src, tag, comm, req_ptr++);
}
- smpi_mpi_waitall(num_req, reqs, stat);
+ Request::waitall(num_req, reqs, stat);
free(reqs);
free(stat);
if (intra_rank == 0) {
for (i = 1; i < num_core_in_current_smp; i++) {
//printf("rank = %d, num = %d send to %d\n",rank, num_core_in_current_smp, (rank + i));
- smpi_mpi_send(recv_buf, (scount * comm_size), stype, (rank + i), tag, comm);
+ Request::send(recv_buf, (scount * comm_size), stype, (rank + i), tag, comm);
}
} else {
//printf("rank = %d recv from %d\n",rank, (inter_rank * num_core));
- smpi_mpi_recv(recv_buf, (rcount * comm_size), rtype, (inter_rank * num_core),
+ Request::recv(recv_buf, (rcount * comm_size), rtype, (inter_rank * num_core),
tag, comm, &status);
}