Skip to content

Commit

Permalink
Correct some 32-bit wrapper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Nov 22, 2023
1 parent a50e500 commit b537a8c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
43 changes: 32 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# docker build --build-arg GITHASH=$(git rev-parse HEAD) --tag mpitrampoline6 --progress plain .
# docker build --build-arg cpuarch=amd64 --build-arg GITHASH=$(git rev-parse HEAD) --build-arg mpivendor=MPICH --tag mpitrampoline6 --progress plain .
# docker run --interactive --rm --tty mpitrampoline6

FROM ubuntu:23.10
# amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, riscv64
ARG cpuarch=amd64

ENV DEBIAN_FRONTEND=noninteractive
FROM ${cpuarch}/debian:12.2

# MPICH, OpenMPI
ARG mpivendor=MPICH

# 1. Install dependencies

ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt --yes --no-install-recommends install \
build-essential \
ca-certificates \
cmake \
gdb \
git \
less \
libmpich-dev \
ninja-build

# Install system MPI
RUN case $mpivendor in \
MPICH) pkgs=libmpich-dev;; \
OpenMPI) pkgs=libopenmpi-dev;; \
*) exit 1;; \
esac && \
apt-get --yes --no-install-recommends install ${pkgs}

# 2. Download MPItrampoline

ARG GITHASH
Expand All @@ -29,24 +40,34 @@ RUN git clone -b eschnett/MPItrampoline6 https://github.com/eschnett/MPItrampoli

WORKDIR /MPItrampoline/mpiwrapper
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_Fortran_COMPILER=mpifort \
-DCMAKE_INSTALL_PREFIX=/usr/local
RUN cmake --build build --config Debug
RUN cmake --install build --config Debug
RUN cmake --build build
RUN cmake --install build
ENV MPITRAMPOLINE_LIB=/usr/local/lib/libmpiwrapper.so

# 4. Build MPItrampoline

WORKDIR /MPItrampoline/mpitrampoline
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/usr/local
RUN cmake --build build --config Debug
RUN cmake --install build --config Debug
RUN cmake --build build
RUN cmake --install build

# 5. Run test

WORKDIR /MPItrampoline/test
RUN cc -Wall -g -c hello-world.c
RUN cc -Wall -g -o hello-world hello-world.o -lmpitrampoline

RUN /usr/local/bin/mpicc -c hello-world.c
RUN /usr/local/bin/mpicc -o hello-world hello-world.o
RUN ./hello-world
RUN mpiexec -n 4 ./hello-world

RUN /usr/local/bin/mpifc -c hello-world-fortran.f90
RUN /usr/local/bin/mpifc -o hello-world-fortran hello-world-fortran.o
RUN ./hello-world-fortran
RUN mpiexec -n 4 ./hello-world-fortran
1 change: 0 additions & 1 deletion mpiabi/mpiabif_types.h
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

16 changes: 8 additions & 8 deletions mpiwrapper/mpiwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -5066,9 +5066,9 @@ int MPIABI_Ineighbor_alltoallv_c(
MPI_Count mpi_sendcounts[size];
for (int n = 0; n < size; ++n)
mpi_sendcounts[n] = sendcounts[n];
MPI_Aint mpi_rdispls[size];
MPI_Aint mpi_sdispls[size];
for (int n = 0; n < size; ++n)
mpi_rdispls[n] = rdispls[n];
mpi_sdispls[n] = sdispls[n];
MPI_Count mpi_recvcounts[size];
for (int n = 0; n < size; ++n)
mpi_recvcounts[n] = recvcounts[n];
Expand Down Expand Up @@ -5131,9 +5131,9 @@ int MPIABI_Ineighbor_alltoallw_c(const void *sendbuf,
MPI_Count mpi_sendcounts[size];
for (int n = 0; n < size; ++n)
mpi_sendcounts[n] = sendcounts[n];
MPI_Aint mpi_rdispls[size];
MPI_Aint mpi_sdispls[size];
for (int n = 0; n < size; ++n)
mpi_rdispls[n] = rdispls[n];
mpi_sdispls[n] = sdispls[n];
MPI_Count mpi_recvcounts[size];
for (int n = 0; n < size; ++n)
mpi_recvcounts[n] = recvcounts[n];
Expand Down Expand Up @@ -5472,9 +5472,9 @@ int MPIABI_Neighbor_alltoallw_c(
MPI_Count mpi_sendcounts[size];
for (int n = 0; n < size; ++n)
mpi_sendcounts[n] = sendcounts[n];
MPI_Aint mpi_rdispls[size];
MPI_Aint mpi_sdispls[size];
for (int n = 0; n < size; ++n)
mpi_rdispls[n] = rdispls[n];
mpi_sdispls[n] = sdispls[n];
MPI_Count mpi_recvcounts[size];
for (int n = 0; n < size; ++n)
mpi_recvcounts[n] = recvcounts[n];
Expand Down Expand Up @@ -5536,9 +5536,9 @@ int MPIABI_Neighbor_alltoallw_init_c(
MPI_Count mpi_sendcounts[size];
for (int n = 0; n < size; ++n)
mpi_sendcounts[n] = sendcounts[n];
MPI_Aint mpi_rdispls[size];
MPI_Aint mpi_sdispls[size];
for (int n = 0; n < size; ++n)
mpi_rdispls[n] = rdispls[n];
mpi_sdispls[n] = sdispls[n];
MPI_Count mpi_recvcounts[size];
for (int n = 0; n < size; ++n)
mpi_recvcounts[n] = recvcounts[n];
Expand Down

0 comments on commit b537a8c

Please sign in to comment.