diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index 942535323..ee4e48c8b 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -903,7 +903,7 @@ register_metadata(pdc_transfer_request_start_all_pkg **transfer_request_input, i * sorted in terms of data_server_id. We pack data from user buffer to contiguous buffers. Static partitioning * requires having at most n_data_servers number of contiguous regions. */ -static int +static perr_t prepare_start_all_requests(pdcid_t *transfer_request_id, int size, pdc_transfer_request_start_all_pkg ***write_transfer_request_ptr, pdc_transfer_request_start_all_pkg ***read_transfer_request_ptr, @@ -934,7 +934,7 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, printf("PDC Client PDCregion_transfer_start_all attempt to start existing transfer request @ " "line %d\n", __LINE__); - return 1; + return FAIL; } if (transfer_request->consistency == PDC_CONSISTENCY_POSIX) { posix_transfer_request_id_ptr[0][posix_size_ptr[0]] = transfer_request_id[i]; @@ -959,6 +959,11 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, &(transfer_request->n_obj_servers), &(transfer_request->obj_servers), &(transfer_request->sub_offsets), &(transfer_request->output_offsets), &(transfer_request->output_sizes), &(transfer_request->output_buf)); + if (transfer_request->n_obj_servers == 0) { + printf("PDC_Client %d, %s: error with static region partition, no server is selected!\n", + pdc_client_mpi_rank_g, __func__); + return FAIL; + } for (j = 0; j < transfer_request->n_obj_servers; ++j) { request_pkgs = (pdc_transfer_request_start_all_pkg *)malloc(sizeof(pdc_transfer_request_start_all_pkg)); @@ -1082,7 +1087,7 @@ prepare_start_all_requests(pdcid_t *transfer_request_id, int size, else { *read_size_ptr = 0; } - return 0; + return SUCCEED; } static int @@ -1321,8 +1326,9 @@ PDCregion_transfer_start_all(pdcid_t *transfer_request_id, int size) FUNC_ENTER(NULL); // Split write and read requests. Handle them separately. // printf("PDCregion_transfer_start_all: checkpoint %d\n", __LINE__); - prepare_start_all_requests(transfer_request_id, size, &write_transfer_requests, &read_transfer_requests, - &write_size, &read_size, &posix_transfer_request_id, &posix_size); + ret_value = prepare_start_all_requests(transfer_request_id, size, &write_transfer_requests, + &read_transfer_requests, &write_size, &read_size, + &posix_transfer_request_id, &posix_size); /* printf("PDCregion_transfer_start_all: checkpoint %d, write_size = %d, read_size = %d\n", __LINE__, write_size, read_size); @@ -1454,12 +1460,18 @@ PDCregion_transfer_start(pdcid_t transfer_request_id) if (transfer_request->region_partition == PDC_REGION_STATIC) { // Identify which part of the region is going to which data server. - static_region_partition(transfer_request->new_buf, transfer_request->remote_region_ndim, unit, - transfer_request->access_type, transfer_request->obj_dims, - transfer_request->remote_region_offset, transfer_request->remote_region_size, - 1, &(transfer_request->n_obj_servers), &(transfer_request->obj_servers), - &(transfer_request->sub_offsets), &(transfer_request->output_offsets), - &(transfer_request->output_sizes), &(transfer_request->output_buf)); + ret_value = static_region_partition( + transfer_request->new_buf, transfer_request->remote_region_ndim, unit, + transfer_request->access_type, transfer_request->obj_dims, transfer_request->remote_region_offset, + transfer_request->remote_region_size, 1, &(transfer_request->n_obj_servers), + &(transfer_request->obj_servers), &(transfer_request->sub_offsets), + &(transfer_request->output_offsets), &(transfer_request->output_sizes), + &(transfer_request->output_buf)); + if (transfer_request->n_obj_servers == 0) { + printf("PDC_Client %d, %s: error with static region partition, no server is selected!\n", + pdc_client_mpi_rank_g, __func__); + return FAIL; + } /* printf("n_obj_servers = %d\n", transfer_request->n_obj_servers); for ( i = 0; i < transfer_request->n_obj_servers; ++i ) { diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 13c2a5a31..30667ddcd 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -207,6 +207,7 @@ set(SCRIPTS run_test.sh mpi_test.sh run_multiple_test.sh + run_multiple_mpi_test.sh run_checkpoint_restart_test.sh ) @@ -487,6 +488,7 @@ if(BUILD_MPI_TESTING) add_test(NAME obj_info_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND mpi_test.sh ./obj_info ${MPI_RUN_CMD} 4 6 ) add_test(NAME obj_put_data_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND mpi_test.sh ./obj_put_data ${MPI_RUN_CMD} 4 6 ) add_test(NAME obj_get_data_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND mpi_test.sh ./obj_get_data ${MPI_RUN_CMD} 4 6 ) + add_test(NAME vpicio_bdcats_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND run_multiple_mpi_test.sh ${MPI_RUN_CMD} 4 6 ./vpicio ./bdcats) set_tests_properties(read_obj_shared_int PROPERTIES LABELS "parallel;parallel_obj" ) set_tests_properties(read_obj_shared_float PROPERTIES LABELS "parallel;parallel_obj" ) @@ -514,6 +516,7 @@ if(BUILD_MPI_TESTING) # set_tests_properties(region_transfer_2D_skewed_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" ) # set_tests_properties(region_transfer_3D_skewed_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" ) set_tests_properties(region_transfer_write_read_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" ) + set_tests_properties(vpicio_bdcats_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" ) set_tests_properties(region_transfer_all_mpi PROPERTIES LABELS "parallel;parallel_region_transfer_all" ) set_tests_properties(region_transfer_all_2D_mpi PROPERTIES LABELS "parallel;parallel_region_transfer_all" ) set_tests_properties(region_transfer_all_3D_mpi PROPERTIES LABELS "parallel;parallel_region_transfer_all" ) diff --git a/src/tests/run_multiple_mpi_test.sh b/src/tests/run_multiple_mpi_test.sh new file mode 100644 index 000000000..957473fa8 --- /dev/null +++ b/src/tests/run_multiple_mpi_test.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# This version of the test runner doesn't attempt to run any parallel tests. +# We assume too, that if the library build has enabled MPI, that LD_LIBRARY_PATH is +# defined and points to the MPI libraries used by the linker (e.g. -L