int PMPI_Init(int *argc, char ***argv)
{
smpi_process_init(argc, argv);
+ smpi_process_mark_as_initialized();
#ifdef HAVE_TRACING
int rank = smpi_process_index();
TRACE_smpi_init(rank);
|| ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
retval = MPI_ERR_TYPE;
} else {
-
- if(recvbuf==MPI_IN_PLACE){
- recvcount=0;
+ if (recvbuf == MPI_IN_PLACE) {
+ recvtype=sendtype;
+ recvcount=sendcount;
}
mpi_coll_scatter_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
recvtype, root, comm);
|| ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
retval = MPI_ERR_TYPE;
} else {
-
- if(recvbuf==MPI_IN_PLACE){
- recvcount=0;
+ if (recvbuf == MPI_IN_PLACE) {
+ recvtype=sendtype;
+ recvcount=sendcounts[smpi_comm_rank(comm)];
}
-
smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
recvcount, recvtype, root, comm);
retval = MPI_SUCCESS;
retval = MPI_ERR_ARG;
} else {
- char* sendtmpbuf = (char*) sendbuf;
- if( sendbuf == MPI_IN_PLACE ) {
- sendtmpbuf = (char *)xbt_malloc(count*smpi_datatype_get_extent(datatype));
- smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
- }
-
- mpi_coll_reduce_fun(sendtmpbuf, recvbuf, count, datatype, op, root, comm);
-
- if( sendbuf == MPI_IN_PLACE ) {
- xbt_free(sendtmpbuf);
- }
+ mpi_coll_reduce_fun(sendbuf, recvbuf, count, datatype, op, root, comm);
retval = MPI_SUCCESS;
}
return retval;
}
+int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+ int retval;
+
+ smpi_bench_end();
+ if (old_type == MPI_DATATYPE_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else if (count<0){
+ retval = MPI_ERR_COUNT;
+ } else {
+ retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
int retval,i;
return retval;
}
+int PMPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+ return PMPI_Type_hindexed(count, blocklens,indices,old_type,new_type);
+}
+
int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
int retval,i;
int PMPI_Initialized(int* flag) {
- *flag=(smpi_process_data()!=NULL);
+ *flag=smpi_process_initialized();
return MPI_SUCCESS;
}