From 554e27c22e65a005eeb4a701c038bb3aaa353478 Mon Sep 17 00:00:00 2001 From: Chris Chambreau Date: Tue, 28 Jun 2022 19:14:48 -0700 Subject: [PATCH 1/4] Clarify documentation test use and status. Signed-off-by: Chris Chambreau --- events/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/events/README.md b/events/README.md index 454d87e..0fb3aef 100644 --- a/events/README.md +++ b/events/README.md @@ -39,7 +39,18 @@ The behavior of each test can be modified with the following command line argume ## Event Callback and Read Data Example The events_example.c file has been provided as an example of registering an event callback and reading event data. +It can be used with the Open MPI '--mca pml ob1' mpiexec flags to generate MPI_T Event callback behavior and +confirm callback functionality. + +## Known Open MPI MPI_T Event test failures + +- MPI_T_event_handle_free : user_data is not accessible in callback function +- MPI_T_event_handle_set_info, MPI_T_event_callback_set_info : keys are not added to Info objects + +## Possible Additional Tests + +- MPI_T_event_set_dropped_handler : Functionality is not currently implemented for dropped events in Open MPI, but a test to co nfirm that the dropped handler is called could be useful. ## Test Suite And MPI Implementations -Tested with [Open MPI PR #8057](https://github.com/open-mpi/ompi/pull/8057) with pml ob1 module events. \ No newline at end of file +Tested with [Open MPI PR #8057](https://github.com/open-mpi/ompi/pull/8057) with pml ob1 module events. From ed07d4eb770fd237b492510769ac719ae9e4f075 Mon Sep 17 00:00:00 2001 From: Chris Chambreau Date: Tue, 28 Jun 2022 19:15:20 -0700 Subject: [PATCH 2/4] Remove dropped callback test for unimplemented functionality. Signed-off-by: Chris Chambreau --- events/events_dropped.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/events/events_dropped.c b/events/events_dropped.c index 5e5e687..0c016cb 100644 --- a/events/events_dropped.c +++ b/events/events_dropped.c @@ -31,11 +31,11 @@ void print_results() { if ( 0 != rank ) return; - if ( 0 == event_dropped_cb_success ) - error_count++; + //if ( 0 == event_dropped_cb_success ) + // error_count++; print_pf_result("MPI_T_event_set_dropped_handler", "Event Set Dropped Callback Success", event_set_dropped_handler_success); - print_pf_result("MPI_T_event_set_dropped_handler", "Event Set Dropped Callback Called", event_dropped_cb_success); + //print_pf_result("MPI_T_event_set_dropped_handler", "Event Set Dropped Callback Called", event_dropped_cb_success); fprintf(outstream, "%-*s - %-*s : %6d\n", func_width, "TOTAL ERROR COUNT", metric_width, "", error_count); From 40318b10e8642878f83d6abe90116bc5859e54eb Mon Sep 17 00:00:00 2001 From: Chris Chambreau Date: Tue, 28 Jun 2022 19:16:14 -0700 Subject: [PATCH 3/4] Correct initial values for INOUT variables name_len and desc_len. Signed-off-by: Chris Chambreau --- events/events_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/events_source.c b/events/events_source.c index 98a3fac..8879524 100644 --- a/events/events_source.c +++ b/events/events_source.c @@ -36,7 +36,7 @@ void test_source() { int num_sources, source_index; MPI_Count timestamp; char name[MAX_STRING], desc[MAX_STRING]; - int name_len, desc_len; + int name_len = MAX_STRING, desc_len = MAX_STRING; MPI_Count ticks_per_second, max_ticks; MPI_Info info; MPI_T_source_order ordering; From ad9d418ee3ed338ea8590535fc12c5812b3dcd0e Mon Sep 17 00:00:00 2001 From: Chris Chambreau Date: Tue, 28 Jun 2022 19:17:08 -0700 Subject: [PATCH 4/4] Add tests to check for negative INOUT length values for name_len and desc_len. Signed-off-by: Chris Chambreau --- events/events_types.c | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/events/events_types.c b/events/events_types.c index 821c647..20d3bf8 100644 --- a/events/events_types.c +++ b/events/events_types.c @@ -17,6 +17,8 @@ int event_info_failed = 0; int event_info_displacements_start_at_0 = 1; int event_count_result = 0; int event_get_num_handle_null = 0; +int event_info_negative_name_len_handled = 1; +int event_info_negative_desc_len_handled = 1; void print_results() { @@ -32,6 +34,8 @@ void print_results() { if ( do_failure_tests ) { print_pf_result("MPI_T_event_get_num", "Handle NULL argument", event_get_num_handle_null); + print_pf_result("MPI_T_event_get_info", "Handle negative name length", event_info_negative_name_len_handled); + print_pf_result("MPI_T_event_get_info", "Handle negative desc length", event_info_negative_desc_len_handled); } fprintf(outstream, "%-*s - %-*s : %6d\n", func_width, "TOTAL ERROR COUNT", metric_width, "", error_count); @@ -199,6 +203,61 @@ void test_get_info() { } } + + if ( do_failure_tests ) { + + int save_name_len; + + save_name_len = ci.name_len; + + /* name_len and desc_len are INOUT arguments and should handle negative values + * Ideally it would return MPI_ERR_ARG (although not specified in MPI Standard v4.0), + * but otherwise it should at least not segfault.*/ + ci.name_len = -100; + print_debug("Testing MPI_T_event_get_info with negative name_len\n"); + retval = MPI_T_event_get_info( + ci.event_index, + ci.name, + &(ci.name_len), + &(ci.verbosity), + ci.array_of_datatypes, + ci.array_of_displacements, + &(ci.num_elements), + &(ci.enumtype), + &(ci.info), + ci.desc, + &(ci.desc_len), + &(ci.bind) + ) ; + + if (MPI_ERR_ARG != retval && 1 == event_info_negative_name_len_handled ) { + event_info_negative_name_len_handled = 0; + } + + ci.name_len = save_name_len; + ci.desc_len = -100; + + print_debug("Testing MPI_T_event_get_info with negative name_len\n"); + retval = MPI_T_event_get_info( + ci.event_index, + ci.name, + &(ci.name_len), + &(ci.verbosity), + ci.array_of_datatypes, + ci.array_of_displacements, + &(ci.num_elements), + &(ci.enumtype), + &(ci.info), + ci.desc, + &(ci.desc_len), + &(ci.bind) + ) ; + + if (MPI_ERR_ARG != retval && 1 == event_info_negative_desc_len_handled ) { + event_info_negative_desc_len_handled = 0; + } + } + free(ci.name); free(ci.desc); free(infos);