if (group == NULL) {
retval = MPI_ERR_ARG;
} else {
+ if(*group!= smpi_comm_group(MPI_COMM_WORLD))// do not free the group of the comm_world
smpi_group_destroy(*group);
*group = MPI_GROUP_NULL;
retval = MPI_SUCCESS;
} else if (src == MPI_PROC_NULL) {
*request = MPI_REQUEST_NULL;
retval = MPI_SUCCESS;
+ } else if (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0)){
+ retval = MPI_ERR_COMM;
} else if (count < 0) {
retval = MPI_ERR_COUNT;
+ } else if (buf==NULL && count > 0) {
+ retval = MPI_ERR_COUNT;
} else if (datatype == MPI_DATATYPE_NULL){
retval = MPI_ERR_TYPE;
+ } else if(tag<0 && tag != MPI_ANY_TAG){
+ retval = MPI_ERR_TAG;
} else {
#ifdef HAVE_TRACING
} else if (dst == MPI_PROC_NULL) {
*request = MPI_REQUEST_NULL;
retval = MPI_SUCCESS;
+ } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
+ retval = MPI_ERR_COMM;
} else if (count < 0) {
retval = MPI_ERR_COUNT;
+ } else if (buf==NULL && count > 0) {
+ retval = MPI_ERR_COUNT;
} else if (datatype == MPI_DATATYPE_NULL){
retval = MPI_ERR_TYPE;
+ } else if(tag<0 && tag != MPI_ANY_TAG){
+ retval = MPI_ERR_TAG;
} else {
#ifdef HAVE_TRACING
smpi_empty_status(status);
status->MPI_SOURCE = MPI_PROC_NULL;
retval = MPI_SUCCESS;
+ } else if (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0)){
+ retval = MPI_ERR_COMM;
} else if (count < 0) {
retval = MPI_ERR_COUNT;
+ } else if (buf==NULL && count > 0) {
+ retval = MPI_ERR_COUNT;
} else if (datatype == MPI_DATATYPE_NULL){
retval = MPI_ERR_TYPE;
+ } else if(tag<0 && tag != MPI_ANY_TAG){
+ retval = MPI_ERR_TAG;
} else {
#ifdef HAVE_TRACING
int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
retval = MPI_ERR_COMM;
} else if (dst == MPI_PROC_NULL) {
retval = MPI_SUCCESS;
+ } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
+ retval = MPI_ERR_COMM;
} else if (count < 0) {
retval = MPI_ERR_COUNT;
+ } else if (buf==NULL && count > 0) {
+ retval = MPI_ERR_COUNT;
} else if (datatype == MPI_DATATYPE_NULL){
retval = MPI_ERR_TYPE;
+ } else if(tag<0 && tag != MPI_ANY_TAG){
+ retval = MPI_ERR_TAG;
} else {
#ifdef HAVE_TRACING
smpi_empty_status(status);
status->MPI_SOURCE = MPI_PROC_NULL;
retval = MPI_SUCCESS;
+ }else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0 ||
+ (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0))){
+ retval = MPI_ERR_COMM;
} else if (sendcount < 0 || recvcount<0) {
retval = MPI_ERR_COUNT;
+ } else if ((sendbuf==NULL && sendcount > 0)||(recvbuf==NULL && recvcount>0)) {
+ retval = MPI_ERR_COUNT;
+ } else if((sendtag<0 && sendtag != MPI_ANY_TAG)||(recvtag<0 && recvtag != MPI_ANY_TAG)){
+ retval = MPI_ERR_TAG;
} else {
#ifdef HAVE_TRACING
smpi_bench_end();
if (old_type == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
- } else if (count<=0){
+ } else if (count<0){
retval = MPI_ERR_COUNT;
} else {
retval = smpi_datatype_contiguous(count, old_type, new_type);
smpi_bench_end();
if (old_type == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
- } else if (count<=0 || blocklen<=0){
+ } else if (count<0 || blocklen<0){
retval = MPI_ERR_COUNT;
} else {
retval = smpi_datatype_vector(count, blocklen, stride, old_type, new_type);
smpi_bench_end();
if (old_type == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
- } else if (count<=0 || blocklen<=0){
+ } else if (count<0 || blocklen<0){
retval = MPI_ERR_COUNT;
} else {
retval = smpi_datatype_hvector(count, blocklen, stride, old_type, new_type);
smpi_bench_end();
if (old_type == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
- } else if (count<=0){
+ } else if (count<0){
retval = MPI_ERR_COUNT;
} else {
retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
smpi_bench_end();
if (old_type == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
- } else if (count<=0){
+ } else if (count<0){
retval = MPI_ERR_COUNT;
} else {
retval = smpi_datatype_hindexed(count, blocklens, indices, old_type, new_type);
int retval;
smpi_bench_end();
- if (count<=0){
+ if (count<0){
retval = MPI_ERR_COUNT;
} else {
retval = smpi_datatype_struct(count, blocklens, indices, old_types, new_type);