Ejemplo n.º 1
0
    def test_pgi_cuda(self):
        """mvapich2 with pgi and cuda"""
        tc = toolchain()
        tc.CC = 'pgcc'
        tc.CXX = 'pgc++'
        tc.F77 = 'pgfortran'
        tc.FC = 'pgfortran'
        mv2 = mvapich2(toolchain=tc, cuda=True)
        self.assertEqual(
            str(mv2), r'''# MVAPICH2 version 2.3rc2
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/local/cuda/lib64/stubs/libnvidia-ml.so.1 && \
    ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
    mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3rc2.tar.gz && \
    mkdir -p /var/tmp && tar -x -f /var/tmp/mvapich2-2.3rc2.tar.gz -C /var/tmp -z && \
    cd /var/tmp/mvapich2-2.3rc2 &&  CC=pgcc CFLAGS=-ta=tesla:nordc CPPFLAGS='-D__x86_64 -D__align__\(n\)=__attribute__\(\(aligned\(n\)\)\) -D__location__\(a\)=__annotate__\(a\) -DCUDARTAPI=' CXX=pgc++ F77=pgfortran FC=pgfortran LD_LIBRARY_PATH='/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH' ./configure --prefix=/usr/local/mvapich2 --disable-mcast --enable-cuda=basic --with-cuda=/usr/local/cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /var/tmp/mvapich2-2.3rc2.tar.gz /var/tmp/mvapich2-2.3rc2
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH \
    PROFILE_POSTLIB="-L/usr/local/cuda/lib64/stubs -lnvidia-ml -lcuda"''')
Ejemplo n.º 2
0
 def test_toolchain(self):
     """Toolchain"""
     mv2 = mvapich2()
     tc = mv2.toolchain
     self.assertEqual(tc.CC, 'mpicc')
     self.assertEqual(tc.CXX, 'mpicxx')
     self.assertEqual(tc.FC, 'mpifort')
     self.assertEqual(tc.F77, 'mpif77')
     self.assertEqual(tc.F90, 'mpif90')
Ejemplo n.º 3
0
    def test_runtime(self):
        """Runtime"""
        mv2 = mvapich2()
        r = mv2.runtime()
        s = '\n'.join(str(x) for x in r)
        self.assertEqual(
            s, r'''# MVAPICH2
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        openssh-client && \
    rm -rf /var/lib/apt/lists/*
COPY --from=0 /usr/local/mvapich2 /usr/local/mvapich2
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH''')
    def test_directory(self):
        """Directory in local build context"""
        mv2 = mvapich2(directory='mvapich2-2.3')
        self.assertEqual(
            str(mv2), r'''# MVAPICH2
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
COPY mvapich2-2.3 /tmp/mvapich2-2.3
RUN cd /tmp/mvapich2-2.3 &&   ./configure --prefix=/usr/local/mvapich2 --disable-mcast --with-cuda=/usr/local/cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /tmp/mvapich2-2.3
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH''')
Ejemplo n.º 5
0
    def test_nocuda(self):
        """Disable CUDA"""
        mv2 = mvapich2(cuda=False)
        self.assertEqual(
            str(mv2), r'''# MVAPICH2 version 2.3rc2
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3rc2.tar.gz && \
    mkdir -p /var/tmp && tar -x -f /var/tmp/mvapich2-2.3rc2.tar.gz -C /var/tmp -z && \
    cd /var/tmp/mvapich2-2.3rc2 &&   ./configure --prefix=/usr/local/mvapich2 --disable-mcast --disable-cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /var/tmp/mvapich2-2.3rc2.tar.gz /var/tmp/mvapich2-2.3rc2
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH''')
    def test_defaults(self):
        """Default mvapich2 building block"""
        mv2 = mvapich2()
        self.assertEqual(
            str(mv2), r'''# MVAPICH2 version 2.3b
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
RUN mkdir -p /tmp && wget -q --no-check-certificate -P /tmp http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3b.tar.gz && \
    tar -x -f /tmp/mvapich2-2.3b.tar.gz -C /tmp -z && \
    cd /tmp/mvapich2-2.3b &&   ./configure --prefix=/usr/local/mvapich2 --disable-mcast --with-cuda=/usr/local/cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /tmp/mvapich2-2.3b.tar.gz /tmp/mvapich2-2.3b
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH''')
Ejemplo n.º 7
0
    def test_directory(self):
        """Directory in local build context"""
        mv2 = mvapich2(directory='mvapich2-2.3')
        self.assertEqual(
            str(mv2), r'''# MVAPICH2
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
COPY mvapich2-2.3 /var/tmp/mvapich2-2.3
RUN ln -s /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/local/cuda/lib64/stubs/libnvidia-ml.so.1 && \
    ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
    cd /var/tmp/mvapich2-2.3 &&   ./configure --prefix=/usr/local/mvapich2 --disable-mcast --enable-cuda --with-cuda=/usr/local/cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /var/tmp/mvapich2-2.3
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH \
    PROFILE_POSTLIB="-L/usr/local/cuda/lib64/stubs -lnvidia-ml -lcuda"''')
Ejemplo n.º 8
0
    def test_defaults_ubuntu(self):
        """Default mvapich2 building block"""
        mv2 = mvapich2()
        self.assertEqual(
            str(mv2), r'''# MVAPICH2 version 2.3rc2
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/local/cuda/lib64/stubs/libnvidia-ml.so.1 && \
    ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
    mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3rc2.tar.gz && \
    mkdir -p /var/tmp && tar -x -f /var/tmp/mvapich2-2.3rc2.tar.gz -C /var/tmp -z && \
    cd /var/tmp/mvapich2-2.3rc2 &&   ./configure --prefix=/usr/local/mvapich2 --disable-mcast --enable-cuda --with-cuda=/usr/local/cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /var/tmp/mvapich2-2.3rc2.tar.gz /var/tmp/mvapich2-2.3rc2
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH \
    PROFILE_POSTLIB="-L/usr/local/cuda/lib64/stubs -lnvidia-ml -lcuda"''')
Ejemplo n.º 9
0
    def test_gpu_arch(self):
        """mvapich2 GPU architecture"""
        mv2 = mvapich2(version='2.3b', gpu_arch='sm_60')
        self.assertEqual(
            str(mv2), r'''# MVAPICH2 version 2.3b
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        byacc \
        file \
        openssh-client \
        wget && \
    rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/local/cuda/lib64/stubs/libnvidia-ml.so /usr/local/cuda/lib64/stubs/libnvidia-ml.so.1 && \
    ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
    mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3b.tar.gz && \
    mkdir -p /var/tmp && tar -x -f /var/tmp/mvapich2-2.3b.tar.gz -C /var/tmp -z && \
    sed -i -e 's/-arch sm_20/-arch sm_60/g' /var/tmp/mvapich2-2.3b/Makefile.in && \
    cd /var/tmp/mvapich2-2.3b &&   ./configure --prefix=/usr/local/mvapich2 --disable-mcast --enable-cuda --with-cuda=/usr/local/cuda && \
    make -j4 && \
    make -j4 install && \
    rm -rf /var/tmp/mvapich2-2.3b.tar.gz /var/tmp/mvapich2-2.3b
ENV LD_LIBRARY_PATH=/usr/local/mvapich2/lib:$LD_LIBRARY_PATH \
    PATH=/usr/local/mvapich2/bin:$PATH \
    PROFILE_POSTLIB="-L/usr/local/cuda/lib64/stubs -lnvidia-ml -lcuda"''')