diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a7c4ecbb6..075dad47b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -33,4 +33,4 @@ jobs: sudo sh -c 'echo "`ipconfig getifaddr en0` PDC" >> /etc/hosts' sudo scutil --set HostName PDC export HG_TRANSPORT="sockets" - ctest -L serial + ctest -L serial --output-on-failure diff --git a/.github/workflows/ubuntu-cache.yml b/.github/workflows/ubuntu-cache.yml index b19896a2b..1b4cdcb68 100644 --- a/.github/workflows/ubuntu-cache.yml +++ b/.github/workflows/ubuntu-cache.yml @@ -28,4 +28,4 @@ jobs: - name: Test PDC working-directory: build - run: ctest -L serial + run: ctest -L serial --output-on-failure diff --git a/.github/workflows/ubuntu-no-cache.yaml b/.github/workflows/ubuntu-no-cache.yaml index 805c54f3f..fe284d118 100644 --- a/.github/workflows/ubuntu-no-cache.yaml +++ b/.github/workflows/ubuntu-no-cache.yaml @@ -28,4 +28,4 @@ jobs: - name: Test PDC working-directory: build - run: ctest -L serial + run: ctest -L serial --output-on-failure diff --git a/src/api/pdc_client_connect.c b/src/api/pdc_client_connect.c index 50e299565..4a0bc0d08 100644 --- a/src/api/pdc_client_connect.c +++ b/src/api/pdc_client_connect.c @@ -43,6 +43,7 @@ #include "pdc_transforms_common.h" #include "pdc_client_connect.h" #include "pdc_logger.h" +#include "pdc_malloc.h" #include "mercury.h" #include "mercury_macros.h" @@ -1354,7 +1355,7 @@ PDC_Client_mercury_init(hg_class_t **hg_class, hg_context_t **hg_context, int po { perr_t ret_value = SUCCEED; char na_info_string[NA_STRING_INFO_LEN]; - char hostname[HOSTNAME_LEN]; + char * hostname; int local_server_id; /* Set the default mercury transport * but enable overriding that to any of: @@ -1378,14 +1379,19 @@ PDC_Client_mercury_init(hg_class_t **hg_class, hg_context_t **hg_context, int po if ((hg_transport = getenv("HG_TRANSPORT")) == NULL) { hg_transport = default_hg_transport; } - memset(hostname, 0, sizeof(hostname)); - gethostname(hostname, sizeof(hostname)); + if ((hostname = getenv("HG_HOST")) == NULL) { + hostname = PDC_malloc(HOSTNAME_LEN); + memset(hostname, 0, HOSTNAME_LEN); + gethostname(hostname, HOSTNAME_LEN - 1); + } sprintf(na_info_string, "%s://%s:%d", hg_transport, hostname, port); if (pdc_client_mpi_rank_g == 0) { - LOG_INFO("==PDC_CLIENT: using %.7s\n", na_info_string); + LOG_INFO("==PDC_CLIENT: using %s\n", na_info_string); fflush(stdout); } + free(hostname); + // gni starts here #ifdef PDC_HAS_CRAY_DRC /* Acquire credential */ diff --git a/src/server/pdc_server.c b/src/server/pdc_server.c index 7ec555db9..847c7d075 100644 --- a/src/server/pdc_server.c +++ b/src/server/pdc_server.c @@ -58,6 +58,7 @@ #include "pdc_server_region_cache.h" #include "pdc_server_region_transfer_metadata_query.h" #include "pdc_logger.h" +#include "pdc_malloc.h" #ifdef PDC_HAS_CRAY_DRC #include @@ -783,7 +784,7 @@ PDC_Server_init(int port, hg_class_t **hg_class, hg_context_t **hg_context) int i = 0; char self_addr_string[ADDR_MAX]; char na_info_string[NA_STRING_INFO_LEN]; - char hostname[HOSTNAME_LEN]; + char * hostname; struct hg_init_info init_info = {0}; /* Set the default mercury transport @@ -817,11 +818,16 @@ PDC_Server_init(int port, hg_class_t **hg_class, hg_context_t **hg_context) if ((hg_transport = getenv("HG_TRANSPORT")) == NULL) { hg_transport = default_hg_transport; } - memset(hostname, 0, HOSTNAME_LEN); - gethostname(hostname, HOSTNAME_LEN - 1); + if ((hostname = getenv("HG_HOST")) == NULL) { + hostname = PDC_malloc(HOSTNAME_LEN); + memset(hostname, 0, HOSTNAME_LEN); + gethostname(hostname, HOSTNAME_LEN - 1); + } snprintf(na_info_string, NA_STRING_INFO_LEN, "%s://%s:%d", hg_transport, hostname, port); if (pdc_server_rank_g == 0) - LOG_INFO("==PDC_SERVER[%d]: using %.7s\n", pdc_server_rank_g, na_info_string); + LOG_INFO("==PDC_SERVER[%d]: using %s\n", pdc_server_rank_g, na_info_string); + + free(hostname); // Clean up all the tmp files etc HG_Cleanup();