int src_traced = smpi_group_index(smpi_comm_group(comm), src);
TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
TRACE_smpi_send(rank, rank, dst_traced);
- TRACE_smpi_send(rank, src_traced, rank);
#endif
#ifdef HAVE_TRACING
TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
- TRACE_smpi_recv(rank, rank, dst_traced);
TRACE_smpi_recv(rank, src_traced, rank);
TRACE_smpi_computing_in(rank);
#endif
//TODO: suboptimal implementation
void *recvbuf;
int retval;
- if ((datatype == MPI_DATATYPE_NULL)||(datatype->has_subtype==1)) {
+ if (datatype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
} else if (count < 0) {
retval = MPI_ERR_COUNT;
} else {
- int size = smpi_datatype_size(datatype) * count;
+ int size = smpi_datatype_get_extent(datatype) * count;
recvbuf = xbt_new(char, size);
retval =
MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count,
datatype, src, recvtag, comm, status);
if(retval==MPI_SUCCESS){
- memcpy(buf, recvbuf, size * sizeof(char));
+ smpi_datatype_copy(recvbuf, count, datatype, buf, count, datatype);
}
xbt_free(recvbuf);
: -1;
TRACE_smpi_computing_out(rank);
- MPI_Group group = smpi_comm_group((*request)->comm);
- int src_traced = smpi_group_index(group, (*request)->src);
- int dst_traced = smpi_group_index(group, (*request)->dst);
+ int src_traced = (*request)->src;
+ int dst_traced = (*request)->dst;
int is_wait_for_receive = (*request)->recv;
TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
#endif
int valid_count = 0;
for (i = 0; i < count; i++) {
MPI_Request req = requests[i];
- if(req){
+ if(req!=MPI_REQUEST_NULL){
srcs[valid_count] = req->src;
dsts[valid_count] = req->dst;
recvs[valid_count] = req->recv;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
} else {
- smpi_mpi_bcast(buf, count, datatype, root, comm);
+ mpi_coll_bcast_fun(buf, count, datatype, root, comm);
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
|| recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
} else {
- smpi_mpi_gather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
+ mpi_coll_gather_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
recvtype, root, comm);
retval = MPI_SUCCESS;
}
|| recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
} else {
- smpi_mpi_allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
- recvtype, comm);
+ mpi_coll_allgather_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
+ recvtype, comm);
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
} else if (recvcounts == NULL || displs == NULL) {
retval = MPI_ERR_ARG;
} else {
- smpi_mpi_allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
+ mpi_coll_allgatherv_fun(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
displs, recvtype, comm);
retval = MPI_SUCCESS;
}
} else if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
retval = MPI_ERR_ARG;
} else {
- smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
+ mpi_coll_reduce_fun(sendbuf, recvbuf, count, datatype, op, root, comm);
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
} else {
- smpi_mpi_allreduce(sendbuf, recvbuf, count, datatype, op, comm);
+ mpi_coll_allreduce_fun(sendbuf, recvbuf, count, datatype, op, comm);
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
- int retval, i, size, count;
- int *displs;
+ int retval;
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-
smpi_bench_end();
#ifdef HAVE_TRACING
TRACE_smpi_computing_out(rank);
} else if (recvcounts == NULL) {
retval = MPI_ERR_ARG;
} else {
- /* arbitrarily choose root as rank 0 */
- /* TODO: faster direct implementation ? */
- size = smpi_comm_size(comm);
- count = 0;
- displs = xbt_new(int, size);
- for (i = 0; i < size; i++) {
- count += recvcounts[i];
- displs[i] = 0;
- }
- smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
- smpi_mpi_scatterv(recvbuf, recvcounts, displs, datatype, recvbuf,
- recvcounts[rank], datatype, 0, comm);
- xbt_free(displs);
+
+ mpi_coll_reduce_scatter_fun(sendbuf, recvbuf, recvcounts,
+ datatype, op, comm);
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
- int retval, size, sendsize;
+ int retval;
smpi_bench_end();
#ifdef HAVE_TRACING
|| recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
} else {
- size = smpi_comm_size(comm);
- sendsize = smpi_datatype_size(sendtype) * sendcount;
- if (sendsize < 200 && size > 12) {
- retval =
- smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
- recvbuf, recvcount, recvtype,
- comm);
- } else if (sendsize < 3000) {
- retval =
- smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
- sendtype, recvbuf,
- recvcount, recvtype, comm);
- } else {
- retval =
- smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
- recvbuf, recvcount, recvtype,
- comm);
- }
+ retval = mpi_coll_alltoall_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
}
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
retval = MPI_ERR_ARG;
} else {
retval =
- smpi_coll_basic_alltoallv(sendbuf, sendcounts, senddisps, sendtype,
+ mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps, sendtype,
recvbuf, recvcounts, recvdisps, recvtype,
comm);
}
} else if (count<0){
retval = MPI_ERR_COUNT;
} else {
- retval = smpi_datatype_contiguous(count, old_type, new_type);
+ retval = smpi_datatype_contiguous(count, old_type, new_type, 0);
}
smpi_bench_begin();
return retval;
return not_yet_implemented();
}
+int PMPI_Win_fence( int assert, MPI_Win win){
+ return not_yet_implemented();
+}
+
+int PMPI_Win_free( MPI_Win* win){
+ return not_yet_implemented();
+}
+
+int PMPI_Win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win){
+ return not_yet_implemented();
+}
+
+int PMPI_Info_create( MPI_Info *info){
+ return not_yet_implemented();
+}
+
+int PMPI_Info_set( MPI_Info *info, char *key, char *value){
+ return not_yet_implemented();
+}
+
+int PMPI_Info_free( MPI_Info *info){
+ return not_yet_implemented();
+}
+
+int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+ MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win){
+ return not_yet_implemented();
+}