Skip to content

Commit

Permalink
Resolving conflict between develop and stable (#173)
Browse files Browse the repository at this point in the history
* Synchronize stable with develop branch (#152)
* Resolve conflicts
  • Loading branch information
zhangwei217245 authored Jan 9, 2024
1 parent 8395abe commit 0c34825
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ make -j && make install
export LD_LIBRARY_PATH="$PDC_DIR/lib:$LD_LIBRARY_PATH"
export PATH="$PDC_DIR/include:$PDC_DIR/lib:$PATH"
echo 'export LD_LIBRARY_PATH=$PDC_DIR/lib:$LD_LIBRARY_PATH' >> $WORK_SPACE/pdc_env.sh
echo 'export PATH=$PDC_DIR/include:$PDC_DIR/lib:$PATH' >> $WORK_SPACE/pdc_env.sh
echo 'export PATH=$PDC_DIR/include:$PDC_DIR/lib:$PATH' >> $WORK_SPACE/pdc_env.sh
2 changes: 1 addition & 1 deletion .devcontainer/post-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
nohup /bin/bash /workspaces/pdc/.devcontainer/post-create.sh 2>&1 > /workspaces/pdc_install.out &

echo "Wait for 10 seconds for the building processes to start."
sleep 10s
sleep 10s
90 changes: 90 additions & 0 deletions .docker/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Use Ubuntu Jammy (latest LTS) as the base image
FROM ubuntu:jammy

# Install necessary tools, MPICH, UUID library and developer files
RUN apt-get update && apt-get install -y \
build-essential \
git \
mpich \
libmpich-dev \
uuid \
uuid-dev \
autoconf \
libtool \
cmake \
cmake-curses-gui \
wget \
axel \
curl \
vim \
nano \
gdb \
cgdb \
curl \
valgrind

# Set WORK_SPACE environment variable and create necessary directories
ENV WORK_SPACE=/home/codespace
RUN mkdir -p $WORK_SPACE

# Clone the repositories
WORKDIR $WORK_SPACE/source
RUN git clone https://github.com/ofiwg/libfabric.git && \
git clone https://github.com/mercury-hpc/mercury.git --recursive

COPY ./ ${WORK_SPACE}/source/pdc

ENV LIBFABRIC_SRC_DIR=$WORK_SPACE/source/libfabric
ENV MERCURY_SRC_DIR=$WORK_SPACE/source/mercury
ENV PDC_SRC_DIR=$WORK_SPACE/source/pdc
ENV LIBFABRIC_DIR=$WORK_SPACE/install/libfabric
ENV MERCURY_DIR=$WORK_SPACE/install/mercury
ENV PDC_DIR=$WORK_SPACE/install/pdc

RUN mkdir -p $LIBFABRIC_SRC_DIR \
mkdir -p $MERCURY_SRC_DIR \
mkdir -p $PDC_SRC_DIR \
mkdir -p $LIBFABRIC_DIR \
mkdir -p $MERCURY_DIR \
mkdir -p $PDC_DIR


# Save the environment variables to a file
RUN echo "export LIBFABRIC_SRC_DIR=$WORK_SPACE/source/libfabric" > $WORK_SPACE/pdc_env.sh && \
echo "export MERCURY_SRC_DIR=$WORK_SPACE/source/mercury" >> $WORK_SPACE/pdc_env.sh && \
echo "export PDC_SRC_DIR=$WORK_SPACE/source/pdc" >> $WORK_SPACE/pdc_env.sh && \
echo "export LIBFABRIC_DIR=$WORK_SPACE/install/libfabric" >> $WORK_SPACE/pdc_env.sh && \
echo "export MERCURY_DIR=$WORK_SPACE/install/mercury" >> $WORK_SPACE/pdc_env.sh && \
echo "export PDC_DIR=$WORK_SPACE/install/pdc" >> $WORK_SPACE/pdc_env.sh


# Build and install libfabric
WORKDIR $LIBFABRIC_SRC_DIR
RUN git checkout v1.18.0 && \
./autogen.sh && \
./configure --prefix=$LIBFABRIC_DIR CC=mpicc CFLAG="-O2" && \
make clean && \
make -j && make install && \
make check

ENV LD_LIBRARY_PATH="$LIBFABRIC_DIR/lib:$LD_LIBRARY_PATH"
ENV PATH="$LIBFABRIC_DIR/include:$LIBFABRIC_DIR/lib:$PATH"
RUN echo 'export LD_LIBRARY_PATH=$LIBFABRIC_DIR/lib:$LD_LIBRARY_PATH' >> $WORK_SPACE/pdc_env.sh && \
echo 'export PATH=$LIBFABRIC_DIR/include:$LIBFABRIC_DIR/lib:$PATH' >> $WORK_SPACE/pdc_env.sh


# Build and install Mercury
WORKDIR $MERCURY_SRC_DIR
ENV MERCURY_CMAKE_FLAGS="-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=tcp "
RUN git checkout v2.2.0 \
mkdir -p build
WORKDIR ${MERCURY_SRC_DIR}/build
RUN cmake $MERCURY_CMAKE_FLAGS ../ && \
make -j && make install && \
ctest

# Set the environment variables
ENV LD_LIBRARY_PATH="$MERCURY_DIR/lib:$LD_LIBRARY_PATH"
ENV PATH="$MERCURY_DIR/include:$MERCURY_DIR/lib:$PATH"
RUN echo 'export LD_LIBRARY_PATH=$MERCURY_DIR/lib:$LD_LIBRARY_PATH' >> $WORK_SPACE/pdc_env.sh \
echo 'export PATH=$MERCURY_DIR/include:$MERCURY_DIR/lib:$PATH' >> $WORK_SPACE/pdc_env.sh
29 changes: 29 additions & 0 deletions .docker/local.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Note: Run `docker build -f .docker/Dockerfile -t pdc:latest .` from the root directory of the repository to build the docker image.

# Use Ubuntu Jammy (latest LTS) as the base image
FROM zhangwei217245/pdc_dev_base:latest

# Build and install PDC
ENV PDC_CMAKE_FLAGS="-DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=$PDC_DIR -DPDC_ENABLE_MPI=ON -DMERCURY_DIR=$MERCURY_DIR -DCMAKE_C_COMPILER=mpicc -DMPI_RUN_CMD=mpiexec "


WORKDIR $PDC_SRC_DIR
RUN rm -rf build && \
mkdir -p build

# COPY ../ ${PDC_SRC_DIR}
# RUN ls -l $PDC_SRC_DIR

WORKDIR ${PDC_SRC_DIR}/build
RUN cmake $PDC_CMAKE_FLAGS ../ 2>&1 > ./cmake_config.log || echo "ignoring cmake config error and proceed" && \
make -j && make install

# Set the environment variables
ENV LD_LIBRARY_PATH="$PDC_DIR/lib:$LD_LIBRARY_PATH"
ENV PATH="$PDC_DIR/include:$PDC_DIR/lib:$PATH"
RUN echo 'export LD_LIBRARY_PATH=$PDC_DIR/lib:$LD_LIBRARY_PATH' >> $WORK_SPACE/pdc_env.sh && \
echo 'export PATH=$PDC_DIR/include:$PDC_DIR/lib:$PATH' >> $WORK_SPACE/pdc_env.sh


# WORKDIR $PDC_SRC_DIR/build
# RUN ctest
2 changes: 2 additions & 0 deletions .docker/local.Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Exclude files and directories from the Docker build context
!/.git/
2 changes: 1 addition & 1 deletion src/server/pdc_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2384,4 +2384,4 @@ server_run(int argc, char *argv[])
MPI_Finalize();
#endif
return 0;
}
}
7 changes: 6 additions & 1 deletion src/server/pdc_server_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,12 @@ PDC_Server_query_kvtag_someta(pdc_kvtag_t *in, uint32_t *n_meta, uint64_t **obj_
*obj_ids = (void *)realloc(*obj_ids, alloc_size * sizeof(uint64_t));
}
(*obj_ids)[iter++] = elt->obj_id;
break;
// break; // FIXME: shall we break here? or continue to check other kvtags?
}
else {
#ifdef PDC_DEBUG_OUTPUT
println("[NOT FOUND]");
#endif
}
} // End for each kvtag in list
} // End for each metadata from hash table entry
Expand Down
2 changes: 1 addition & 1 deletion src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ add_library(cjson cjson/cJSON.c)
foreach(program ${PROGRAMS})
add_executable(${program} ${program}.c)
target_link_libraries(${program} pdc cjson ${TOOLS_EXT_LIB})
endforeach(program)
endforeach(program)

0 comments on commit 0c34825

Please sign in to comment.