Skip to content

Commit

Permalink
sessions: modify datatype tests cleanup path
Browse files Browse the repository at this point in the history
With the changes for sessions, OMPI uses a different way
of cleaning up allocated resources,namely using a
registration of cleanup callbacks that are invoked
when opal_finalize_cleanup_domain is called on the
list of callbacks.  This obviates the need, for example,
for a test to explicitly cleanup datatype related resources
by invoking ompi_datatype_finalize explicitly.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
  • Loading branch information
hppritcha committed Jul 6, 2021
1 parent 1e86fd8 commit 5e9df52
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion ompi/datatype/ompi_datatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ OMPI_DECLSPEC extern opal_convertor_t* ompi_mpi_local_convertor;
extern struct opal_pointer_array_t ompi_datatype_f_to_c_table;

OMPI_DECLSPEC int32_t ompi_datatype_init( void );
OMPI_DECLSPEC int32_t ompi_datatype_finalize( void );

OMPI_DECLSPEC int32_t ompi_datatype_default_convertors_init( void );
OMPI_DECLSPEC int32_t ompi_datatype_default_convertors_fini( void );
Expand Down
4 changes: 3 additions & 1 deletion ompi/datatype/ompi_datatype_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

#include "mpi.h"

static int ompi_datatype_finalize (void);

/**
* This is the number of predefined datatypes. It is different than the MAX_PREDEFINED
* as it include all the optional datatypes (such as MPI_INTEGER?, MPI_REAL?).
Expand Down Expand Up @@ -687,7 +689,7 @@ int32_t ompi_datatype_init( void )
}


int ompi_datatype_finalize (void)
static int ompi_datatype_finalize (void)
{
int ret = OMPI_SUCCESS;

Expand Down
1 change: 0 additions & 1 deletion test/datatype/checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ int main(int argc, char *argv[])
free(packed);

/* clean-ups all data allocations */
ompi_datatype_finalize();
opal_finalize_util();

return 0;
Expand Down
1 change: 0 additions & 1 deletion test/datatype/ddt_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ int main(int argc, char *argv[])
ompi_datatype_destroy(&dup_type);

cleanup:
ompi_datatype_finalize();
opal_finalize_util();

return ret;
Expand Down
1 change: 0 additions & 1 deletion test/datatype/ddt_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ int main(int argc, char *argv[])
assert(pdt1 == NULL);

/* clean-ups all data allocations */
ompi_datatype_finalize();
opal_finalize_util();

return OMPI_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion test/datatype/ddt_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ int main(int argc, char *argv[])
assert(pdt2 == NULL);

/* clean-ups all data allocations */
ompi_datatype_finalize();
opal_finalize_util();

return OMPI_SUCCESS;
}
2 changes: 1 addition & 1 deletion test/datatype/external32.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ int main(int argc, char *argv[])
}
}

ompi_datatype_finalize();
opal_finalize_util();

return 0;
}
1 change: 0 additions & 1 deletion test/datatype/partial.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ int main(int argc, char *argv[])
free(packed);

/* clean-ups all data allocations */
ompi_datatype_finalize();
opal_finalize_util();

return 0;
Expand Down
1 change: 0 additions & 1 deletion test/datatype/position.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ int main(int argc, char *argv[])
}
free(segments);

ompi_datatype_finalize();
opal_finalize_util();

return (0 == errors ? 0 : -1);
Expand Down
1 change: 0 additions & 1 deletion test/datatype/position_noncontig.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ int main(int argc, char *argv[])
}
free(segments);

ompi_datatype_finalize();
opal_finalize_util();

return (0 == errors ? 0 : -1);
Expand Down

0 comments on commit 5e9df52

Please sign in to comment.