double PMPI_Wtime(void)
{
- double time;
- if (smpi_process_initialized() && !smpi_process_finalized() && !smpi_process_get_sampling()) {
- smpi_bench_end();
- time = SIMIX_get_clock();
- smpi_bench_begin();
- } else {
- time = SIMIX_get_clock();
- }
- return time;
+ return smpi_mpi_wtime();
}
extern double sg_maxmin_precision;
int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
{
- int retval, i, index;
+ int retval;
if (group == MPI_GROUP_NULL) {
retval = MPI_ERR_GROUP;
} else if (newgroup == NULL) {
retval = MPI_ERR_ARG;
} else {
- if (n == 0) {
- *newgroup = MPI_GROUP_EMPTY;
- } else if (n == smpi_group_size(group)) {
- *newgroup = group;
- if(group!= smpi_comm_group(MPI_COMM_WORLD)
- && group != MPI_GROUP_NULL
- && group != smpi_comm_group(MPI_COMM_SELF)
- && group != MPI_GROUP_EMPTY)
- smpi_group_use(group);
- } else {
- *newgroup = smpi_group_new(n);
- for (i = 0; i < n; i++) {
- index = smpi_group_index(group, ranks[i]);
- smpi_group_set_mapping(*newgroup, index, i);
- }
- }
- retval = MPI_SUCCESS;
+ retval = smpi_group_incl(group, n, ranks, newgroup);
}
return retval;
}
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ } else if (!is_datatype_valid(datatype)) {
+ retval = MPI_ERR_ARG;
} else {
#ifdef HAVE_TRACING
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (((smpi_comm_rank(comm)==root) && (sendtype == MPI_DATATYPE_NULL))
- || ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
+ } else if (((smpi_comm_rank(comm)==root) && (!is_datatype_valid(sendtype)))
+ || ((recvbuf !=MPI_IN_PLACE) && (!is_datatype_valid(recvtype)))){
retval = MPI_ERR_TYPE;
- } else {
+ } else if ((sendbuf == recvbuf) ||
+ ((smpi_comm_rank(comm)==root) && sendcount>0 && (sendbuf == NULL))){
+ retval = MPI_ERR_BUFFER;
+ }else {
if (recvbuf == MPI_IN_PLACE) {
recvtype=sendtype;
return retval;
}
+int PMPI_Win_set_name(MPI_Win win, char * name)
+{
+ int retval = 0;
+ if (win == MPI_WIN_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else if (name == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ smpi_mpi_win_set_name(win, name);
+ retval = MPI_SUCCESS;
+ }
+ return retval;
+}
+
+int PMPI_Win_get_name(MPI_Win win, char * name, int* len)
+{
+ int retval = 0;
+
+ if (win == MPI_WIN_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else if (name == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ smpi_mpi_win_get_name(win, name, len);
+ retval = MPI_SUCCESS;
+ }
+ return retval;
+}
+
int PMPI_Win_fence( int assert, MPI_Win win){
int retval = 0;
return MPI_SUCCESS;
}
+int PMPI_Type_set_name(MPI_Datatype datatype, char * name)
+{
+ int retval = 0;
+ if (datatype == MPI_DATATYPE_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else if (name == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ smpi_datatype_set_name(datatype, name);
+ retval = MPI_SUCCESS;
+ }
+ return retval;
+}
+int PMPI_Type_get_name(MPI_Datatype datatype, char * name, int* len)
+{
+ int retval = 0;
+
+ if (datatype == MPI_DATATYPE_NULL) {
+ retval = MPI_ERR_TYPE;
+ } else if (name == NULL) {
+ retval = MPI_ERR_ARG;
+ } else {
+ smpi_datatype_get_name(datatype, name, len);
+ retval = MPI_SUCCESS;
+ }
+ return retval;
+}
/* The following calls are not yet implemented and will fail at runtime. */
/* Once implemented, please move them above this notice. */
return MPI_SUCCESS; \
}
-int PMPI_Type_set_name(MPI_Datatype datatype, char * name)
-{
- NOT_YET_IMPLEMENTED
-}
-int PMPI_Type_get_name(MPI_Datatype datatype, char * name, int* len)
-{
- NOT_YET_IMPLEMENTED
-}
int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
NOT_YET_IMPLEMENTED