From eeb1b73389c458addb2d2a9565196b003dc768bf Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Thu, 26 Oct 2023 12:01:12 -0700 Subject: [PATCH 01/29] include MacOS in CI --- .github/workflows/dependencies-macos.sh | 24 ++++++++++++++++++++ .github/workflows/macos.yml | 29 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 .github/workflows/dependencies-macos.sh create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh new file mode 100755 index 000000000..0f3d186b9 --- /dev/null +++ b/.github/workflows/dependencies-macos.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +brew install open-mpi + +# libfabric +wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.12.1.tar.gz +tar xf v1.12.1.tar.gz +cd libfabric-1.12.1 +./autogen.sh +./configure --disable-usnic --disable-mrail --disable-rstream --disable-perf --disable-efa --disable-psm2 --disable-psm --disable-verbs --disable-shm --disable-static --disable-silent-rules +make -j2 && sudo make install +make check +cd .. + +# Mercury +git clone --recursive https://github.com/mercury-hpc/mercury.git +cd mercury +git checkout v2.1.0 +mkdir build && cd build +cmake ../ -DCMAKE_C_COMPILER=gcc -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DNA_USE_OFI=ON -DNA_USE_SM=OFF -DMERCURY_USE_CHECKSUMS=OFF +make -j2 && sudo make install +ctest diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..d625d0d92 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,29 @@ +name: MacOS + +on: + pull_request: + branches: [ stable, develop ] + + # Allows to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + PDC: + runs-on: macos-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v3 + + - name: Dependencies + run: .github/workflows/dependencies-macos.sh + + - name: Build PDC + run: | + mkdir build && cd build + cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc + make -j2 + + - name: Test PDC + working-directory: build + run: ctest -L serial From 61d8dbe76bc05edd989980deeb8fd221e229faa9 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Thu, 26 Oct 2023 12:04:15 -0700 Subject: [PATCH 02/29] include dependencies --- .github/workflows/dependencies-macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index 0f3d186b9..6362162b6 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -2,7 +2,7 @@ set -eu -o pipefail -brew install open-mpi +brew install open-mpi autoconf automake libtool # libfabric wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.12.1.tar.gz From a816793afa4ca883ebdf92dc4d27ccdfa7ad098a Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Thu, 26 Oct 2023 12:14:27 -0700 Subject: [PATCH 03/29] replace tcp with sockets --- .github/workflows/dependencies-macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index 6362162b6..1bbf88b06 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -19,6 +19,6 @@ git clone --recursive https://github.com/mercury-hpc/mercury.git cd mercury git checkout v2.1.0 mkdir build && cd build -cmake ../ -DCMAKE_C_COMPILER=gcc -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DNA_USE_OFI=ON -DNA_USE_SM=OFF -DMERCURY_USE_CHECKSUMS=OFF +cmake ../ -DCMAKE_C_COMPILER=gcc -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DNA_USE_OFI=ON -DNA_USE_SM=OFF -DMERCURY_USE_CHECKSUMS=OFF -DNA_OFI_TESTING_PROTOCOL=sockets make -j2 && sudo make install ctest From c151eb929e6ac17acf07711fc866008c5ef158e6 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Thu, 26 Oct 2023 13:02:23 -0700 Subject: [PATCH 04/29] add libuuid --- .github/workflows/dependencies-macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index 1bbf88b06..0b734e1d3 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -2,7 +2,7 @@ set -eu -o pipefail -brew install open-mpi autoconf automake libtool +brew install open-mpi autoconf automake libtool ossp-uuid # libfabric wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.12.1.tar.gz From 181e2a4cfff97ea44946f28bd2a55b51ba840616 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 14:04:33 -0700 Subject: [PATCH 05/29] rename file --- .github/workflows/{linux.yml => ubuntu.yml} | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) rename .github/workflows/{linux.yml => ubuntu.yml} (74%) diff --git a/.github/workflows/linux.yml b/.github/workflows/ubuntu.yml similarity index 74% rename from .github/workflows/linux.yml rename to .github/workflows/ubuntu.yml index cdce9b776..5b6e33066 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/ubuntu.yml @@ -1,4 +1,4 @@ -name: linux +name: Ubuntu on: # push: @@ -27,14 +27,6 @@ jobs: cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc make -j2 - # - name: Debug test PDC - # working-directory: ./src/build/bin - # run: | - # mpirun -n 1 ./pdc_server.exe & - # sleep 1 - # mpirun -n 1 ./pdc_init - # mpirun -n 1 ./close_server - - name: Test PDC working-directory: build run: ctest -L serial From 1cdb4885857fea5af998e2ab9ba098c02273e2dd Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 14:06:22 -0700 Subject: [PATCH 06/29] fix find UUID to correctly locate files in Ubuntu and MacOS --- CMake/FindUUID.cmake | 67 ++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/CMake/FindUUID.cmake b/CMake/FindUUID.cmake index 22d87b38f..bc93ce805 100644 --- a/CMake/FindUUID.cmake +++ b/CMake/FindUUID.cmake @@ -1,36 +1,41 @@ -# FindUUID.cmake +# On Mac OS X the uuid functions are in the System library -# Find the system's UUID library -# This will define: -# -# UUID_FOUND - System has UUID -# UUID_INCLUDE_DIRS - The UUID include directory -# UUID_LIBRARIES - The libraries needed to use UUID +if(APPLE) + set(UUID_LIBRARY_VAR System) +else() + set(UUID_LIBRARY_VAR uuid) +endif() -# - Try to find UUID -# Once done this will define -# UUID_FOUND - System has UUID -# UUID_INCLUDE_DIRS - The UUID include directories -# UUID_LIBRARIES - The libraries needed to use UUID - -find_package(PkgConfig) -pkg_check_modules(PC_UUID uuid) +find_library(UUID_LIBRARY + NAMES ${UUID_LIBRARY_VAR} + PATHS /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib +) find_path(UUID_INCLUDE_DIR uuid/uuid.h HINTS ${PC_UUID_INCLUDEDIR} ${PC_UUID_INCLUDE_DIRS} - PATHS /usr/local/include /usr/include) - -find_library(UUID_LIBRARY NAMES uuid - HINTS ${PC_DRC_LIBDIR} ${PC_DRC_LIBRARY_DIRS} - PATHS /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib) - -set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) -set(UUID_LIBRARIES ${UUID_LIBRARY}) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE -# if all listed variables are TRUE -find_package_handle_standard_args(UUID DEFAULT_MSG - UUID_INCLUDE_DIR UUID_LIBRARY) - -mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) \ No newline at end of file + PATHS /usr/local/include /usr/include +) + +if (UUID_LIBRARY AND UUID_INCLUDE_DIR) + set(UUID_LIBRARIES ${UUID_LIBRARY}) + set(UUID_FOUND "YES") +else () + set(UUID_FOUND "NO") +endif () + +if (UUID_FOUND) + if (NOT UUID_FIND_QUIETLY) + message(STATUS "Found UUID: ${UUID_LIBRARIES}") + endif () +else () + if (UUID_FIND_REQUIRED) + message( "library: ${UUID_LIBRARY}" ) + message( "include: ${UUID_INCLUDE_DIR}" ) + message(FATAL_ERROR "Could not find UUID library") + endif () +endif () + +mark_as_advanced( + UUID_LIBRARY + UUID_INCLUDE_DIR +) \ No newline at end of file From 9cc56932e96795cac0d4b86f6a6e8c305427af48 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 14:09:28 -0700 Subject: [PATCH 07/29] fix random segfault in strdup + malloc due to wrong allocation --- src/commons/utils/include/pdc_malloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commons/utils/include/pdc_malloc.h b/src/commons/utils/include/pdc_malloc.h index 8c3a36335..a0c908835 100644 --- a/src/commons/utils/include/pdc_malloc.h +++ b/src/commons/utils/include/pdc_malloc.h @@ -76,8 +76,8 @@ void *PDC_free(void *mem); */ size_t PDC_get_global_mem_usage(); -#define PDC_MALLOC(t) (t *)PDC_malloc(sizeof(t)) -#define PDC_CALLOC(c, t) (t *)PDC_calloc(c, sizeof(t)) +#define PDC_MALLOC(t) (t *)PDC_malloc(sizeof(t) + 1) +#define PDC_CALLOC(c, t) (t *)PDC_calloc(c, sizeof(t) + 1) #define PDC_FREE(t, obj) (t *)(intptr_t) PDC_free(obj) From b82d723f166926ec87a0b2e2f82c5a3a86be6d51 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 14:16:00 -0700 Subject: [PATCH 08/29] ensure consitency use of defined variables --- src/api/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 7b9a356fb..c92b2c3b0 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -42,7 +42,7 @@ if(MERCURY_FOUND) set(PDC_EXT_INCLUDE_DEPENDENCIES ${MERCURY_INCLUDE_DIR} ${PDC_EXT_INCLUDE_DEPENDENCIES} ) - set(PDC_EXT_LIB_DEPENDENCIES mercury ${PDC_EXT_LIB_DEPENDENCIES}) + set(PDC_EXT_LIB_DEPENDENCIES ${MERCURY_LIBRARIES} ${PDC_EXT_LIB_DEPENDENCIES}) endif() include_directories(${PDC_EXT_INCLUDE_DEPENDENCIES}) From f48cb22fe438441bef864ce97911e9dcb583b1ab Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 14:18:49 -0700 Subject: [PATCH 09/29] change transport for MacOS tests --- .github/workflows/macos.yml | 2 ++ .github/workflows/ubuntu.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d625d0d92..cf02ca4b2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,6 +11,8 @@ jobs: PDC: runs-on: macos-latest timeout-minutes: 60 + env: + HG_TRANSPORT: "sockets" steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5b6e33066..96cf45ea4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -13,6 +13,8 @@ jobs: PDC: runs-on: ubuntu-latest timeout-minutes: 60 + env: + HG_TRANSPORT: "ofi+tcp" steps: - uses: actions/checkout@v3 From a2c6a8e1441303f6bb1da4c541759803f939feb7 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 14:35:53 -0700 Subject: [PATCH 10/29] uncomment code --- CMake/FindMERCURY.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMake/FindMERCURY.cmake b/CMake/FindMERCURY.cmake index d159efbaf..00fd5893d 100644 --- a/CMake/FindMERCURY.cmake +++ b/CMake/FindMERCURY.cmake @@ -27,14 +27,14 @@ if(MERCURY_FOUND) HINTS ${MERCURY_DIR} ) - # find_library(MERCURY_UTIL_LIBRARY - # NAMES - # mercury_util - # HINTS ${MERCURY_DIR} - # ) + find_library(MERCURY_UTIL_LIBRARY + NAMES + mercury_util + HINTS ${MERCURY_DIR} + ) - # set(MERCURY_LIBRARIES ${MERCURY_LIBRARY} ${MERCURY_NA_LIBRARY} ${MERCURY_UTIL_LIBRARY}) - set(MERCURY_LIBRARIES ${MERCURY_LIBRARY} ${MERCURY_NA_LIBRARY}) + set(MERCURY_LIBRARIES ${MERCURY_LIBRARY} ${MERCURY_NA_LIBRARY} ${MERCURY_UTIL_LIBRARY}) + # set(MERCURY_LIBRARIES ${MERCURY_LIBRARY} ${MERCURY_NA_LIBRARY}) set(MERCURY_INCLUDE_DIRS ${MERCURY_INCLUDE_DIR}) message(STATUS "mercury include dir = ${MERCURY_INCLUDE_DIRS}") message(STATUS "mercury lib = ${MERCURY_LIBRARIES}") From 61384fe98fd73acd8051dbc6b0515e6217fc3e85 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 15:11:49 -0700 Subject: [PATCH 11/29] update env --- .github/workflows/macos.yml | 6 +++--- .github/workflows/ubuntu.yml | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cf02ca4b2..12183a2e0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,8 +11,6 @@ jobs: PDC: runs-on: macos-latest timeout-minutes: 60 - env: - HG_TRANSPORT: "sockets" steps: - uses: actions/checkout@v3 @@ -28,4 +26,6 @@ jobs: - name: Test PDC working-directory: build - run: ctest -L serial + run: | + export HG_TRANSPORT="sockets" + ctest -L serial diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 96cf45ea4..5b6e33066 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -13,8 +13,6 @@ jobs: PDC: runs-on: ubuntu-latest timeout-minutes: 60 - env: - HG_TRANSPORT: "ofi+tcp" steps: - uses: actions/checkout@v3 From 040a8d51f9e267ee99d40e5d3d927cd428600997 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Fri, 27 Oct 2023 15:37:54 -0700 Subject: [PATCH 12/29] new version of macos --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 12183a2e0..bfdeeff1c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -9,7 +9,7 @@ on: jobs: PDC: - runs-on: macos-latest + runs-on: macos-13 timeout-minutes: 60 steps: From 971bdea59e85b9a736dd5d666a97ce17bfecbcef Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Mon, 30 Oct 2023 10:00:26 -0700 Subject: [PATCH 13/29] disable tests on MacOS --- .github/workflows/macos.yml | 8 +------- .github/workflows/ubuntu.yml | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bfdeeff1c..6da9fdbf4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -22,10 +22,4 @@ jobs: run: | mkdir build && cd build cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc - make -j2 - - - name: Test PDC - working-directory: build - run: | - export HG_TRANSPORT="sockets" - ctest -L serial + make -j 2 \ No newline at end of file diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5b6e33066..c8c38ba96 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,8 +1,6 @@ name: Ubuntu on: - # push: - # branches: [ stable ] pull_request: branches: [ stable, develop ] From 84f71a4972616112a277d34ac5d4a012b6931c83 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Mon, 30 Oct 2023 10:56:26 -0700 Subject: [PATCH 14/29] Update dependencies-macos.sh --- .github/workflows/dependencies-macos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index 0b734e1d3..2f7c8beaa 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -5,7 +5,7 @@ set -eu -o pipefail brew install open-mpi autoconf automake libtool ossp-uuid # libfabric -wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.12.1.tar.gz +wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.15.2.tar.gz tar xf v1.12.1.tar.gz cd libfabric-1.12.1 ./autogen.sh @@ -17,7 +17,7 @@ cd .. # Mercury git clone --recursive https://github.com/mercury-hpc/mercury.git cd mercury -git checkout v2.1.0 +git checkout v2.2.0 mkdir build && cd build cmake ../ -DCMAKE_C_COMPILER=gcc -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DNA_USE_OFI=ON -DNA_USE_SM=OFF -DMERCURY_USE_CHECKSUMS=OFF -DNA_OFI_TESTING_PROTOCOL=sockets make -j2 && sudo make install From 150a3bb93ce3bfdd14b2174fa9e0d18bf8fe274c Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Mon, 30 Oct 2023 10:58:02 -0700 Subject: [PATCH 15/29] Update dependencies-macos.sh --- .github/workflows/dependencies-macos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index 2f7c8beaa..a8630d2e3 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -6,8 +6,8 @@ brew install open-mpi autoconf automake libtool ossp-uuid # libfabric wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.15.2.tar.gz -tar xf v1.12.1.tar.gz -cd libfabric-1.12.1 +tar xf v1.15.2.tar.gz +cd libfabric-1.15.2 ./autogen.sh ./configure --disable-usnic --disable-mrail --disable-rstream --disable-perf --disable-efa --disable-psm2 --disable-psm --disable-verbs --disable-shm --disable-static --disable-silent-rules make -j2 && sudo make install From d522a05fcc9dea576042be0bfdef4645e200ab6d Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Tue, 31 Oct 2023 09:40:48 -0700 Subject: [PATCH 16/29] rollback change --- src/commons/utils/include/pdc_malloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commons/utils/include/pdc_malloc.h b/src/commons/utils/include/pdc_malloc.h index a0c908835..8c3a36335 100644 --- a/src/commons/utils/include/pdc_malloc.h +++ b/src/commons/utils/include/pdc_malloc.h @@ -76,8 +76,8 @@ void *PDC_free(void *mem); */ size_t PDC_get_global_mem_usage(); -#define PDC_MALLOC(t) (t *)PDC_malloc(sizeof(t) + 1) -#define PDC_CALLOC(c, t) (t *)PDC_calloc(c, sizeof(t) + 1) +#define PDC_MALLOC(t) (t *)PDC_malloc(sizeof(t)) +#define PDC_CALLOC(c, t) (t *)PDC_calloc(c, sizeof(t)) #define PDC_FREE(t, obj) (t *)(intptr_t) PDC_free(obj) From ac80e0a13664548feefd291b515e1580ee8fabef Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Tue, 31 Oct 2023 12:32:15 -0700 Subject: [PATCH 17/29] fixes to the container delete --- src/api/pdc_obj/pdc_cont.c | 11 +++++++---- src/server/pdc_server_metadata.c | 2 +- src/tests/cont_del.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/api/pdc_obj/pdc_cont.c b/src/api/pdc_obj/pdc_cont.c index d0c896816..11fd15dda 100644 --- a/src/api/pdc_obj/pdc_cont.c +++ b/src/api/pdc_obj/pdc_cont.c @@ -86,6 +86,7 @@ PDCcont_create(const char *cont_name, pdcid_t cont_prop_id) p->cont_pt->pdc->local_id = cont_prop->pdc->local_id; ret = PDC_Client_create_cont_id(cont_name, cont_prop_id, &(p->cont_info_pub->meta_id)); + if (ret == FAIL) PGOTO_ERROR(0, "Unable to create container on the server!"); @@ -316,8 +317,10 @@ PDC_cont_get_info(pdcid_t cont_id) FUNC_ENTER(NULL); id_info = PDC_find_id(cont_id); - info = (struct _pdc_cont_info *)(id_info->obj_ptr); + if (id_info == NULL) + PGOTO_ERROR(NULL, "cannot locate object"); + info = (struct _pdc_cont_info *)(id_info->obj_ptr); ret_value = PDC_CALLOC(1, struct _pdc_cont_info); if (ret_value) memcpy(ret_value, info, sizeof(struct _pdc_cont_info)); @@ -326,9 +329,9 @@ PDC_cont_get_info(pdcid_t cont_id) ret_value->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); if (ret_value->cont_info_pub) - memcpy(ret_value, info, sizeof(struct pdc_cont_info)); - else - PGOTO_ERROR(NULL, "cannot allocate ret_value->cont_info_pub"); + //memcpy(ret_value->cont_info_pub, info, sizeof(struct pdc_cont_info)); + memcpy(ret_value->cont_info_pub, info->cont_info_pub, sizeof(struct pdc_cont_info)); + if (info->cont_info_pub->name) ret_value->cont_info_pub->name = strdup(info->cont_info_pub->name); diff --git a/src/server/pdc_server_metadata.c b/src/server/pdc_server_metadata.c index 7eb2abd66..b887d7685 100644 --- a/src/server/pdc_server_metadata.c +++ b/src/server/pdc_server_metadata.c @@ -968,7 +968,7 @@ PDC_Server_delete_metadata_by_id(metadata_delete_by_id_in_t *in, metadata_delete continue; if (cont_entry->cont_id == target_obj_id) { - hash_table_remove(container_hash_table_g, &pair.key); + hash_table_remove(container_hash_table_g, pair.key); out->ret = 1; ret_value = SUCCEED; goto done; diff --git a/src/tests/cont_del.c b/src/tests/cont_del.c index 5ecdf2e6b..3abc1f837 100644 --- a/src/tests/cont_del.c +++ b/src/tests/cont_del.c @@ -80,7 +80,7 @@ main(int argc, char **argv) } printf("trying to open a deleted container, should fail\n"); - cont = PDCcont_open("VPIC_cont", pdc); + cont = PDCcont_open(cont_name, pdc); if (cont > 0) printf("Error: opened a container that was just deleted @ line %d!\n", __LINE__); From b4cc7b7a1adc07752e0eb493e85c810a33a66959 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 31 Oct 2023 19:33:14 +0000 Subject: [PATCH 18/29] Committing clang-format changes --- src/api/pdc_obj/pdc_cont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/pdc_obj/pdc_cont.c b/src/api/pdc_obj/pdc_cont.c index 11fd15dda..4eac5f197 100644 --- a/src/api/pdc_obj/pdc_cont.c +++ b/src/api/pdc_obj/pdc_cont.c @@ -320,7 +320,7 @@ PDC_cont_get_info(pdcid_t cont_id) if (id_info == NULL) PGOTO_ERROR(NULL, "cannot locate object"); - info = (struct _pdc_cont_info *)(id_info->obj_ptr); + info = (struct _pdc_cont_info *)(id_info->obj_ptr); ret_value = PDC_CALLOC(1, struct _pdc_cont_info); if (ret_value) memcpy(ret_value, info, sizeof(struct _pdc_cont_info)); @@ -329,7 +329,7 @@ PDC_cont_get_info(pdcid_t cont_id) ret_value->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); if (ret_value->cont_info_pub) - //memcpy(ret_value->cont_info_pub, info, sizeof(struct pdc_cont_info)); + // memcpy(ret_value->cont_info_pub, info, sizeof(struct pdc_cont_info)); memcpy(ret_value->cont_info_pub, info->cont_info_pub, sizeof(struct pdc_cont_info)); if (info->cont_info_pub->name) From f856258bd0ba5f3023d6d60ff1d99c41d406b330 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Tue, 31 Oct 2023 12:35:54 -0700 Subject: [PATCH 19/29] remove previous code --- src/api/pdc_obj/pdc_cont.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/api/pdc_obj/pdc_cont.c b/src/api/pdc_obj/pdc_cont.c index 4eac5f197..b589188e6 100644 --- a/src/api/pdc_obj/pdc_cont.c +++ b/src/api/pdc_obj/pdc_cont.c @@ -329,7 +329,6 @@ PDC_cont_get_info(pdcid_t cont_id) ret_value->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); if (ret_value->cont_info_pub) - // memcpy(ret_value->cont_info_pub, info, sizeof(struct pdc_cont_info)); memcpy(ret_value->cont_info_pub, info->cont_info_pub, sizeof(struct pdc_cont_info)); if (info->cont_info_pub->name) From 9cc682fdf502f692ab030eb2b76aefa5a128db99 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Tue, 7 Nov 2023 10:02:02 -0800 Subject: [PATCH 20/29] replace found to TRUE/FALSE --- CMake/FindUUID.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMake/FindUUID.cmake b/CMake/FindUUID.cmake index bc93ce805..777e3029c 100644 --- a/CMake/FindUUID.cmake +++ b/CMake/FindUUID.cmake @@ -18,9 +18,9 @@ find_path(UUID_INCLUDE_DIR uuid/uuid.h if (UUID_LIBRARY AND UUID_INCLUDE_DIR) set(UUID_LIBRARIES ${UUID_LIBRARY}) - set(UUID_FOUND "YES") + set(UUID_FOUND "TRUE") else () - set(UUID_FOUND "NO") + set(UUID_FOUND "FALSE") endif () if (UUID_FOUND) @@ -38,4 +38,4 @@ endif () mark_as_advanced( UUID_LIBRARY UUID_INCLUDE_DIR -) \ No newline at end of file +) From 831cf9048b249d84b1221fffe761c4f802220733 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 10:46:57 -0800 Subject: [PATCH 21/29] temporarily add back the tests in MacOS after GitHub new release --- .github/workflows/macos.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6da9fdbf4..f5a53ec34 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -22,4 +22,8 @@ jobs: run: | mkdir build && cd build cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc - make -j 2 \ No newline at end of file + make -j 2 + + - name: Test PDC + working-directory: build + run: ctest -L serial \ No newline at end of file From 6e439a34bbc351aeacd23fa7149a7a195f6542de Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 10:48:36 -0800 Subject: [PATCH 22/29] update documentation with timeout and macos specifics --- docs/source/getting_started.rst | 36 ++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 9c753e7e1..d29ef80af 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -42,6 +42,7 @@ PDC can use either MPICH or OpenMPI as the MPI library, if your system doesn't h We provide detailed instructions for installing libfabric, Mercury, and PDC below. .. attention:: + Following the instructions below will record all the environmental variables needed to run PDC in the ``$WORK_SPACE/pdc_env.sh`` file, which can be used for future PDC runs with ``source $WORK_SPACE/pdc_env.sh``. @@ -118,9 +119,18 @@ Install libfabric .. note:: + ``CC=mpicc`` may need to be changed to the corresponding compiler in your system, e.g. ``CC=cc`` or ``CC=gcc``. On Perlmutter@NERSC, ``--disable-efa --disable-sockets`` should be added to the ``./configure`` command when compiling on login nodes. +.. attention:: + + If you're installing PDC on MacOS, you need to make sure you enable ``sockets``: + + .. code-block: Bash + + ./configure CFLAG=-O2 --enable-sockets=yes --enable-tcp=yes --enable-udp=yes --enable-rxm=yes + Install Mercury --------------- @@ -149,6 +159,15 @@ Install Mercury ``CC=mpicc`` may need to be changed to the corresponding compiler in your system, e.g. ``-DCMAKE_C_COMPILER=cc`` or ``-DCMAKE_C_COMPILER=gcc``. Make sure the ctest passes. PDC may not work without passing all the tests of Mercury. +.. attention:: + + If you're installing PDC on MacOS, for the tests to work you need to specify the protocol used by Mercury: + + .. code-block: Bash + + cmake -DCMAKE_INSTALL_PREFIX=$MERCURY_DIR -DCMAKE_C_COMPILER=mpicc -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=ON -DNA_USE_OFI=ON -DNA_USE_SM=OFF -DNA_OFI_TESTING_PROTOCOL=sockets + Install PDC ----------- @@ -170,12 +189,21 @@ Install PDC echo 'export PATH=$PDC_DIR/include:$PDC_DIR/lib:$PATH' >> $WORK_SPACE/pdc_env.sh .. note:: + ``-DCMAKE_C_COMPILER=mpicc -DMPI_RUN_CMD=mpiexec`` may need to be changed to ``-DCMAKE_C_COMPILER=cc -DMPI_RUN_CMD=srun`` depending on your system environment. .. note:: - If you are trying to compile PDC on your Mac, ``LibUUID`` needs to be installed on your MacOS first. Simple use ``brew install ossp-uuid`` to install it. + + If you are trying to compile PDC on MacOS, ``LibUUID`` needs to be installed on your MacOS first. Simple use ``brew install ossp-uuid`` to install it. If you are trying to compile PDC on Linux, you should also make sure ``LibUUID`` is installed on your system. If not, you can install it with ``sudo apt-get install uuid-dev`` on Ubuntu or ``yum install libuuid-devel`` on CentOS. + In MacOS you also need to export the following environment variable so PDC (i.e., Mercury) uses the ``socket`` protocol, the only one supported in MacOS: + + .. code-block: Bash + + export HG_TRANSPORT="sockets" + + Test Your PDC Installation -------------------------- PDC's ``ctest`` contains both sequential and parallel/MPI tests, and can be run with the following in the `build` directory. @@ -184,6 +212,12 @@ PDC's ``ctest`` contains both sequential and parallel/MPI tests, and can be run ctest +You can also specify a timeout (e.g., 2 minutes) for the tests by specifying the ``timeout`` parameter when calling ``ctest``: + +.. code-block:: Bash + + ctest --timeout 120 + .. note:: If you are using PDC on an HPC system, e.g. Perlmutter@NERSC, ``ctest`` should be run on a compute node, you can submit an interactive job on Perlmutter: ``salloc --nodes 1 --qos interactive --time 01:00:00 --constraint cpu --account=mxxxx`` From ac56982872a1a23bb08e85642c191efb877b6d45 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 10:49:39 -0800 Subject: [PATCH 23/29] fix git link to avoid authentication --- docs/source/getting_started.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index d29ef80af..295517128 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -58,9 +58,9 @@ Before installing the dependencies and downloading the code repository, we assum mkdir -p $WORK_SPACE/install cd $WORK_SPACE/source - git clone git@github.com:ofiwg/libfabric.git - git clone git@github.com:mercury-hpc/mercury.git --recursive - git clone git@github.com:hpc-io/pdc.git + git clone https://github.com/ofiwg/libfabric + git clone https://github.com/mercury-hpc/mercury --recursive + git clone https://github.com/hpc-io/pdc export LIBFABRIC_SRC_DIR=$WORK_SPACE/source/libfabric export MERCURY_SRC_DIR=$WORK_SPACE/source/mercury From 5652574c2ce331dcba7d05b7f23e6b4bef5c4e44 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 11:06:19 -0800 Subject: [PATCH 24/29] update dependencies --- .github/workflows/dependencies-macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index a8630d2e3..fa5771f11 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -2,7 +2,7 @@ set -eu -o pipefail -brew install open-mpi autoconf automake libtool ossp-uuid +brew install open-mpi autoconf automake libtool # libfabric wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.15.2.tar.gz From 73d9f2ea16e83091cfa4207bed93561fb39c62b4 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 11:16:30 -0800 Subject: [PATCH 25/29] update dependencies --- .github/workflows/dependencies-macos.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependencies-macos.sh b/.github/workflows/dependencies-macos.sh index fa5771f11..98b1d33d8 100755 --- a/.github/workflows/dependencies-macos.sh +++ b/.github/workflows/dependencies-macos.sh @@ -2,7 +2,9 @@ set -eu -o pipefail -brew install open-mpi autoconf automake libtool +export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=FALSE + +brew install open-mpi automake # libfabric wget https://github.com/ofiwg/libfabric/archive/refs/tags/v1.15.2.tar.gz From 6e9ffb3ba9c4a58abdd38ac8f68a8d768fcb8983 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 11:25:43 -0800 Subject: [PATCH 26/29] change transport for tests --- .github/workflows/macos.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f5a53ec34..1236c2ed3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,4 +26,6 @@ jobs: - name: Test PDC working-directory: build - run: ctest -L serial \ No newline at end of file + run: | + export HG_TRANSPORT="sockets" + ctest -L serial From c3f710e644078ccc7b71e4426ddbc37109b50e3d Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 11:35:54 -0800 Subject: [PATCH 27/29] temporarily add session debug --- .github/workflows/macos.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1236c2ed3..98784be63 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -24,6 +24,9 @@ jobs: cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc make -j 2 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Test PDC working-directory: build run: | From 4429c487d3e580c38e014a33fdcd64e7d92c2b90 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 11:49:06 -0800 Subject: [PATCH 28/29] configure network for macos tests --- .github/workflows/macos.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 98784be63..b4870f3bb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -24,11 +24,9 @@ jobs: cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc make -j 2 - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - name: Test PDC working-directory: build run: | + sudo sh -c 'echo "`ipconfig getifaddr en0` PDC" >> /etc/hosts' export HG_TRANSPORT="sockets" ctest -L serial From ea570914295e03ebc732543984288f4ecd28446e Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Wed, 13 Dec 2023 11:57:28 -0800 Subject: [PATCH 29/29] configure network for macos tests --- .github/workflows/macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b4870f3bb..4c5fdcf8b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -28,5 +28,6 @@ jobs: working-directory: build run: | sudo sh -c 'echo "`ipconfig getifaddr en0` PDC" >> /etc/hosts' + sudo scutil --set HostName PDC export HG_TRANSPORT="sockets" ctest -L serial