retval = MPI_ERR_ARG;
} else {
*address = (MPI_Aint) location;
+ retval = MPI_SUCCESS;
}
smpi_bench_begin();
return retval;
if (!datatype) {
retval = MPI_ERR_ARG;
} else {
- // FIXME: always fail for now
- retval = MPI_ERR_TYPE;
+ smpi_datatype_free(datatype);
+ retval = MPI_SUCCESS;
}
smpi_bench_begin();
return retval;
return retval;
}
+
int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
int tag, MPI_Comm comm, MPI_Request * request)
{
return retval;
}
+
+
int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
MPI_Comm comm, MPI_Status * status)
{
retval = MPI_SUCCESS;
}
#ifdef HAVE_TRACING
+ //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
+ if(status!=MPI_STATUS_IGNORE)src_traced = smpi_group_rank(smpi_comm_group(comm), status->MPI_SOURCE);
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
TRACE_smpi_recv(rank, src_traced, rank);
TRACE_smpi_computing_in(rank);
return retval;
}
+int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses)
+{
+ int retval;
+ smpi_bench_end();
+ if (flag == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ *flag = smpi_mpi_testall(count, requests, statuses);
+ retval = MPI_SUCCESS;
+ }
+ smpi_bench_begin();
+ return retval;
+}
int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
int retval;
return retval;
}
+int PMPI_Type_contiguous(int count, 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_contiguous(count, old_type, new_type);
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
+int PMPI_Type_commit(MPI_Datatype* datatype) {
+ int retval;
+
+ smpi_bench_end();
+ if (datatype == MPI_DATATYPE_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else {
+ smpi_datatype_commit(datatype);
+ retval = MPI_SUCCESS;
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
+
+int PMPI_Type_vector(int count, int blocklen, int stride, 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 || blocklen<=0){
+ retval = MPI_ERR_COUNT;
+ } else {
+ retval = smpi_datatype_vector(count, blocklen, stride, old_type, new_type);
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
+int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, 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 || blocklen<=0){
+ retval = MPI_ERR_COUNT;
+ } else {
+ retval = smpi_datatype_hvector(count, blocklen, stride, old_type, new_type);
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
+
+int PMPI_Type_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_hindexed(int count, int* blocklens, MPI_Aint* 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_hindexed(count, blocklens, indices, old_type, new_type);
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
+
+int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type) {
+ int retval;
+
+ smpi_bench_end();
+ if (count<=0){
+ retval = MPI_ERR_COUNT;
+ } else {
+ retval = smpi_datatype_struct(count, blocklens, indices, old_types, new_type);
+ }
+ smpi_bench_begin();
+ return retval;}
+
+
/* The following calls are not yet implemented and will fail at runtime. */
/* Once implemented, please move them above this notice. */
static int not_yet_implemented(void) {
- xbt_die("Not yet implemented");
- return MPI_ERR_OTHER;
+ XBT_WARN("Not yet implemented");
+ return MPI_SUCCESS;
}
int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
return not_yet_implemented();
}
-int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
- return not_yet_implemented();
-}
int PMPI_Cancel(MPI_Request* request) {
return not_yet_implemented();
return not_yet_implemented();
}
-int PMPI_Type_commit(MPI_Datatype* datatype) {
- return not_yet_implemented();
-}
-
-int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
- return not_yet_implemented();
-}
-
-int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
- return not_yet_implemented();
-}
-
-int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
- return not_yet_implemented();
-}
-
-int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
- return not_yet_implemented();
-}
-
-int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
- return not_yet_implemented();
-}
-
int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
return not_yet_implemented();
}
}
-
int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
return not_yet_implemented();
}
return not_yet_implemented();
}
-int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) {
- return not_yet_implemented();
-}
-
int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
return not_yet_implemented();
}