From 47ec006930641fc819bb883ed4d0341309cb1812 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Fri, 18 Jun 2004 19:02:52 +0000 Subject: [PATCH] adding the comm and group MPI interface functions to use the new macro developed by Jeff for checking of MPI_Init/Finalize This commit was SVN r1415. --- src/mpi/c/close_port.c | 5 ++--- src/mpi/c/comm_accept.c | 5 ++--- src/mpi/c/comm_compare.c | 4 +--- src/mpi/c/comm_connect.c | 5 ++--- src/mpi/c/comm_create.c | 4 +--- src/mpi/c/comm_disconnect.c | 5 ++--- src/mpi/c/comm_dup.c | 6 ++---- src/mpi/c/comm_free.c | 4 +--- src/mpi/c/comm_get_name.c | 4 +--- src/mpi/c/comm_group.c | 4 +--- src/mpi/c/comm_join.c | 5 ++--- src/mpi/c/comm_rank.c | 4 +--- src/mpi/c/comm_set_name.c | 4 +--- src/mpi/c/comm_size.c | 4 +--- src/mpi/c/comm_spawn.c | 5 ++--- src/mpi/c/comm_spawn_multiple.c | 5 ++--- src/mpi/c/comm_split.c | 4 +--- src/mpi/c/comm_test_inter.c | 4 +--- src/mpi/c/group_compare.c | 2 ++ src/mpi/c/group_difference.c | 2 ++ src/mpi/c/group_excl.c | 2 ++ src/mpi/c/group_free.c | 2 ++ src/mpi/c/group_incl.c | 1 + src/mpi/c/group_intersection.c | 12 ++++++++---- src/mpi/c/group_range_excl.c | 2 ++ src/mpi/c/group_range_incl.c | 2 ++ src/mpi/c/group_rank.c | 2 ++ src/mpi/c/group_size.c | 2 ++ src/mpi/c/group_translate_ranks.c | 2 ++ src/mpi/c/group_union.c | 2 ++ src/mpi/c/intercomm_create.c | 4 +--- src/mpi/c/intercomm_merge.c | 4 +--- src/mpi/c/lookup_name.c | 5 ++--- src/mpi/c/open_port.c | 5 ++--- src/mpi/c/publish_name.c | 5 ++--- src/mpi/c/unpublish_name.c | 5 ++--- 36 files changed, 65 insertions(+), 77 deletions(-) diff --git a/src/mpi/c/close_port.c b/src/mpi/c/close_port.c index 12b22ba3c5..9490777274 100644 --- a/src/mpi/c/close_port.c +++ b/src/mpi/c/close_port.c @@ -20,9 +20,8 @@ int MPI_Close_port(char *port_name) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Close_port"); + OMPI_ERR_INIT_FINALIZE; + if ( NULL == port_name ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, "MPI_Close_port"); diff --git a/src/mpi/c/comm_accept.c b/src/mpi/c/comm_accept.c index eebfee75aa..a3ff13ae67 100644 --- a/src/mpi/c/comm_accept.c +++ b/src/mpi/c/comm_accept.c @@ -30,9 +30,8 @@ int MPI_Comm_accept(char *port_name, MPI_Info info, int root, comp = (ompi_communicator_t *) comm; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_accept"); + OMPI_ERR_INIT_FINALIZE; + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, "MPI_Comm_accept"); diff --git a/src/mpi/c/comm_compare.c b/src/mpi/c/comm_compare.c index c5d7fb5a79..32ffd07843 100644 --- a/src/mpi/c/comm_compare.c +++ b/src/mpi/c/comm_compare.c @@ -30,9 +30,7 @@ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { int found = 0; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_compare"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm1 || MPI_COMM_NULL == comm2 || ompi_comm_invalid ( comm1 ) || ompi_comm_invalid (comm2) ) diff --git a/src/mpi/c/comm_connect.c b/src/mpi/c/comm_connect.c index a2dc37569a..8ca4e83691 100644 --- a/src/mpi/c/comm_connect.c +++ b/src/mpi/c/comm_connect.c @@ -30,9 +30,8 @@ int MPI_Comm_connect(char *port_name, MPI_Info info, int root, comp = (ompi_communicator_t *) comm; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_connect"); + OMPI_ERR_INIT_FINALIZE; + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, "MPI_Comm_connect"); diff --git a/src/mpi/c/comm_create.c b/src/mpi/c/comm_create.c index 01a18c253f..464515d64c 100644 --- a/src/mpi/c/comm_create.c +++ b/src/mpi/c/comm_create.c @@ -22,9 +22,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) { int rc; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_create"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/comm_disconnect.c b/src/mpi/c/comm_disconnect.c index 39f4ac4afb..fea43654fb 100644 --- a/src/mpi/c/comm_disconnect.c +++ b/src/mpi/c/comm_disconnect.c @@ -21,9 +21,8 @@ int MPI_Comm_disconnect(MPI_Comm *comm) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_disconnect"); + OMPI_ERR_INIT_FINALIZE; + if ( MPI_COMM_NULL == *comm || ompi_comm_invalid (*comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, "MPI_Comm_disconnect"); diff --git a/src/mpi/c/comm_dup.c b/src/mpi/c/comm_dup.c index ea5a95f766..895994ccff 100644 --- a/src/mpi/c/comm_dup.c +++ b/src/mpi/c/comm_dup.c @@ -26,10 +26,8 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) { /* argument checking */ if ( MPI_PARAM_CHECK ) { - if (ompi_mpi_finalized) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_dup"); - + OMPI_ERR_INIT_FINALIZE; + if (MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, "MPI_Comm_dup"); diff --git a/src/mpi/c/comm_free.c b/src/mpi/c/comm_free.c index 878cf9a901..a6bf071f8e 100644 --- a/src/mpi/c/comm_free.c +++ b/src/mpi/c/comm_free.c @@ -20,9 +20,7 @@ int MPI_Comm_free(MPI_Comm *comm) { if ( MPI_PARAM_CHECK ) { - if (ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_free"); + OMPI_ERR_INIT_FINALIZE; if ( NULL == *comm || MPI_COMM_WORLD == *comm || MPI_COMM_SELF == *comm || ompi_comm_invalid (*comm)) diff --git a/src/mpi/c/comm_get_name.c b/src/mpi/c/comm_get_name.c index ea97446d8c..1f74fd2df2 100644 --- a/src/mpi/c/comm_get_name.c +++ b/src/mpi/c/comm_get_name.c @@ -26,9 +26,7 @@ int MPI_Comm_get_name(MPI_Comm comm, char *name, int *length) { ompi_communicator_t* comp; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_get_name"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/comm_group.c b/src/mpi/c/comm_group.c index fc04a57339..7e76f3517f 100644 --- a/src/mpi/c/comm_group.c +++ b/src/mpi/c/comm_group.c @@ -23,9 +23,7 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) { /* argument checking */ if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_group"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm) ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/comm_join.c b/src/mpi/c/comm_join.c index 7af233a92f..40e399d1c2 100644 --- a/src/mpi/c/comm_join.c +++ b/src/mpi/c/comm_join.c @@ -27,9 +27,8 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm) comp = (ompi_communicator_t *)MPI_COMM_SELF; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_join"); + OMPI_ERR_INIT_FINALIZE; + if ( NULL == intercomm ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, "MPI_Comm_join"); diff --git a/src/mpi/c/comm_rank.c b/src/mpi/c/comm_rank.c index 844bb1c548..fd09856eb5 100644 --- a/src/mpi/c/comm_rank.c +++ b/src/mpi/c/comm_rank.c @@ -21,9 +21,7 @@ int MPI_Comm_rank(MPI_Comm comm, int *rank) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_rank"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/comm_set_name.c b/src/mpi/c/comm_set_name.c index 6060a07ef3..4ef4cec240 100644 --- a/src/mpi/c/comm_set_name.c +++ b/src/mpi/c/comm_set_name.c @@ -26,9 +26,7 @@ int MPI_Comm_set_name(MPI_Comm comm, char *name) { ompi_communicator_t* comp; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_set_name"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/comm_size.c b/src/mpi/c/comm_size.c index 74353a7414..d4b287b562 100644 --- a/src/mpi/c/comm_size.c +++ b/src/mpi/c/comm_size.c @@ -20,9 +20,7 @@ int MPI_Comm_size(MPI_Comm comm, int *size) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, - MPI_ERR_INTERN, "MPI_Comm_size"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, diff --git a/src/mpi/c/comm_spawn.c b/src/mpi/c/comm_spawn.c index 5f0a173f4c..af52ad0912 100644 --- a/src/mpi/c/comm_spawn.c +++ b/src/mpi/c/comm_spawn.c @@ -31,9 +31,8 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, comp = (ompi_communicator_t *) comm; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_spawn"); + OMPI_ERR_INIT_FINALIZE; + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, "MPI_Comm_spawn"); diff --git a/src/mpi/c/comm_spawn_multiple.c b/src/mpi/c/comm_spawn_multiple.c index b175586e89..cd4de6889a 100644 --- a/src/mpi/c/comm_spawn_multiple.c +++ b/src/mpi/c/comm_spawn_multiple.c @@ -32,9 +32,8 @@ int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_o comp = (ompi_communicator_t *) comm; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_spawn_multiple"); + OMPI_ERR_INIT_FINALIZE; + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, "MPI_Comm_spawn_multiple"); diff --git a/src/mpi/c/comm_split.c b/src/mpi/c/comm_split.c index 43da3eff7b..28ce59cc57 100644 --- a/src/mpi/c/comm_split.c +++ b/src/mpi/c/comm_split.c @@ -22,9 +22,7 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) { int rc; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_split"); + OMPI_ERR_INIT_FINALIZE; if ( comm == MPI_COMM_NULL || ompi_comm_invalid ( comm )) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/comm_test_inter.c b/src/mpi/c/comm_test_inter.c index 2b5ede0f24..dbb4ee5986 100644 --- a/src/mpi/c/comm_test_inter.c +++ b/src/mpi/c/comm_test_inter.c @@ -20,9 +20,7 @@ int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { if ( MPI_PARAM_CHECK ) { - if (ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_test_inter"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM, diff --git a/src/mpi/c/group_compare.c b/src/mpi/c/group_compare.c index 3bd56876d8..c41b77539c 100644 --- a/src/mpi/c/group_compare.c +++ b/src/mpi/c/group_compare.c @@ -31,6 +31,8 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result) { /* check for errors */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if( ( MPI_GROUP_NULL == group1 ) || ( MPI_GROUP_NULL == group2 ) || (NULL == group1) || (NULL==group2) ){ return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, diff --git a/src/mpi/c/group_difference.c b/src/mpi/c/group_difference.c index d3b6af9c56..e180b07b08 100644 --- a/src/mpi/c/group_difference.c +++ b/src/mpi/c/group_difference.c @@ -29,6 +29,8 @@ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, /* error checking */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if( (MPI_GROUP_NULL == group1) || (MPI_GROUP_NULL == group2) || (NULL == group1) || (NULL == group2) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, diff --git a/src/mpi/c/group_excl.c b/src/mpi/c/group_excl.c index 5ea6767974..375ed2155e 100644 --- a/src/mpi/c/group_excl.c +++ b/src/mpi/c/group_excl.c @@ -30,6 +30,8 @@ int MPI_Group_excl(MPI_Group group, int n, int *ranks, group_pointer = (ompi_group_t *)group; if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + /* verify that group is valid group */ if ( (MPI_GROUP_NULL == group) || (NULL == group) || (NULL == ranks) ) { diff --git a/src/mpi/c/group_free.c b/src/mpi/c/group_free.c index 460e2f42da..d66b2e5e6b 100644 --- a/src/mpi/c/group_free.c +++ b/src/mpi/c/group_free.c @@ -24,6 +24,8 @@ int MPI_Group_free(MPI_Group *group) /* check to make sure we don't free GROUP_EMPTY or GROUP_NULL */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE; + if ((MPI_GROUP_NULL == *group) || (MPI_GROUP_EMPTY == *group) || (NULL == *group) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, diff --git a/src/mpi/c/group_incl.c b/src/mpi/c/group_incl.c index d9bfaae012..bab1aad53b 100644 --- a/src/mpi/c/group_incl.c +++ b/src/mpi/c/group_incl.c @@ -28,6 +28,7 @@ int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *new_group) group_pointer = (ompi_group_t *)group; if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; /* verify that group is valid group */ if ( (MPI_GROUP_NULL == group) || ( NULL == group) diff --git a/src/mpi/c/group_intersection.c b/src/mpi/c/group_intersection.c index 2c70a3fbe4..89f5a05a1d 100644 --- a/src/mpi/c/group_intersection.c +++ b/src/mpi/c/group_intersection.c @@ -27,11 +27,15 @@ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, ompi_group_t *group1_pointer, *group2_pointer, *new_group_pointer; ompi_proc_t *proc1_pointer, *proc2_pointer, *my_proc_pointer; - /* verify that groups are valid */ - if ( (MPI_GROUP_NULL == group1) || (MPI_GROUP_NULL == group2) || - ( NULL == group1) || (NULL == group2) ) { + if ( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + + /* verify that groups are valid */ + if ( (MPI_GROUP_NULL == group1) || (MPI_GROUP_NULL == group2) || + ( NULL == group1) || (NULL == group2) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, - "MPI_Group_intersection"); + "MPI_Group_intersection"); + } } group1_pointer=(ompi_group_t *)group1; diff --git a/src/mpi/c/group_range_excl.c b/src/mpi/c/group_range_excl.c index bfc6187dca..6d988da732 100644 --- a/src/mpi/c/group_range_excl.c +++ b/src/mpi/c/group_range_excl.c @@ -31,6 +31,8 @@ int MPI_Group_range_excl(MPI_Group group, int n_triplets, int ranges[][3], /* can't act on NULL group */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if ( (MPI_GROUP_NULL == group) || (NULL == group) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, "MPI_Group_range_excl"); diff --git a/src/mpi/c/group_range_incl.c b/src/mpi/c/group_range_incl.c index 2c58c45836..c28aff7e06 100644 --- a/src/mpi/c/group_range_incl.c +++ b/src/mpi/c/group_range_incl.c @@ -30,6 +30,8 @@ int MPI_Group_range_incl(MPI_Group group, int n_triplets, int ranges[][3], /* can't act on NULL group */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if ( (MPI_GROUP_NULL == group) || (NULL == group) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, "MPI_Group_range_incl"); diff --git a/src/mpi/c/group_rank.c b/src/mpi/c/group_rank.c index d9afe3a952..41a915b8d2 100644 --- a/src/mpi/c/group_rank.c +++ b/src/mpi/c/group_rank.c @@ -22,6 +22,8 @@ int MPI_Group_rank(MPI_Group group, int *rank) { /* error checking */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if( (MPI_GROUP_NULL == group) || ( NULL == group) ){ return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, "MPI_Group_rank"); diff --git a/src/mpi/c/group_size.c b/src/mpi/c/group_size.c index d6f014bd4b..6327f126e0 100644 --- a/src/mpi/c/group_size.c +++ b/src/mpi/c/group_size.c @@ -22,6 +22,8 @@ int MPI_Group_size(MPI_Group group, int *size) { /* error checking */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if( (MPI_GROUP_NULL == group) || (NULL == group) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, "MPI_Group_size"); diff --git a/src/mpi/c/group_translate_ranks.c b/src/mpi/c/group_translate_ranks.c index 68e226e5b2..2e08fed3fd 100644 --- a/src/mpi/c/group_translate_ranks.c +++ b/src/mpi/c/group_translate_ranks.c @@ -30,6 +30,8 @@ int MPI_Group_translate_ranks(MPI_Group group1, int n_ranks, int *ranks1, /* check for errors */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE; + if ((MPI_GROUP_NULL == group1) || (MPI_GROUP_NULL == group2) || (NULL == group1) || (NULL == group2) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, diff --git a/src/mpi/c/group_union.c b/src/mpi/c/group_union.c index dc5c21cef9..1b1727510a 100644 --- a/src/mpi/c/group_union.c +++ b/src/mpi/c/group_union.c @@ -28,6 +28,8 @@ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *new_group) /* check for errors */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE; + if ((MPI_GROUP_NULL == group1) || (MPI_GROUP_NULL == group2) || (NULL == group1) || (NULL == group2) ) { return diff --git a/src/mpi/c/intercomm_create.c b/src/mpi/c/intercomm_create.c index 0b5511d72d..fb81c76637 100644 --- a/src/mpi/c/intercomm_create.c +++ b/src/mpi/c/intercomm_create.c @@ -29,9 +29,7 @@ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, int rc, rsize; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Intercomm_create"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == local_comm || ompi_comm_invalid ( local_comm ) || ( local_comm->c_flags & OMPI_COMM_INTER ) ) diff --git a/src/mpi/c/intercomm_merge.c b/src/mpi/c/intercomm_merge.c index eebed37139..edd397fe53 100644 --- a/src/mpi/c/intercomm_merge.c +++ b/src/mpi/c/intercomm_merge.c @@ -31,9 +31,7 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, int rc=MPI_SUCCESS; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Intercomm_merge"); + OMPI_ERR_INIT_FINALIZE; if ( MPI_COMM_NULL == intercomm || ompi_comm_invalid ( intercomm ) || !( intercomm->c_flags & OMPI_COMM_INTER ) ) diff --git a/src/mpi/c/lookup_name.c b/src/mpi/c/lookup_name.c index 49556c5dc3..a898d56c2e 100644 --- a/src/mpi/c/lookup_name.c +++ b/src/mpi/c/lookup_name.c @@ -24,9 +24,8 @@ int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name) char *tmp; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Lookup_name"); + OMPI_ERR_INIT_FINALIZE; + if ( NULL == port_name ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, "MPI_Lookup_name"); diff --git a/src/mpi/c/open_port.c b/src/mpi/c/open_port.c index ad00fcb923..43cd3e399d 100644 --- a/src/mpi/c/open_port.c +++ b/src/mpi/c/open_port.c @@ -21,9 +21,8 @@ int MPI_Open_port(MPI_Info info, char *port_name) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Open_port"); + OMPI_ERR_INIT_FINALIZE; + if ( NULL == port_name ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, "MPI_Open_port"); diff --git a/src/mpi/c/publish_name.c b/src/mpi/c/publish_name.c index 1539e002c4..7d0a332a82 100644 --- a/src/mpi/c/publish_name.c +++ b/src/mpi/c/publish_name.c @@ -24,9 +24,8 @@ int MPI_Publish_name(char *service_name, MPI_Info info, int rc; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Publish_name"); + OMPI_ERR_INIT_FINALIZE; + if ( NULL == port_name ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, "MPI_Publish_name"); diff --git a/src/mpi/c/unpublish_name.c b/src/mpi/c/unpublish_name.c index 5e270b1bd9..1af9b83f37 100644 --- a/src/mpi/c/unpublish_name.c +++ b/src/mpi/c/unpublish_name.c @@ -24,9 +24,8 @@ int MPI_Unpublish_name(char *service_name, MPI_Info info, int rc; if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Unpublish_name"); + OMPI_ERR_INIT_FINALIZE; + if ( NULL == port_name ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, "MPI_Unpublish_name");