Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mpigraph prototype #30

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions mpigraph/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG tag=jammy
FROM ubuntu:${tag}
ENV DEBIAN_FRONTEND=noninteractive

# mpirun --map-by node -np 2 --allow-run-as-root ./mpiGraph 1048576 10 10 > mpiGraph.out
# ./crunch_mpiGraph mpiGraph.out
# firefox file:///path/to/mpiGraph.out_html/index.html

WORKDIR /opt/
RUN apt-get update && \
apt-get install -y gfortran git curl wget g++ build-essential \
openmpi-bin openmpi-doc libopenmpi-dev && \
wget https://docs.it4i.cz/src/ompi/ompi.tar.gz && \
tar -xzvf ompi.tar.gz && \
rm ompi/Makefile

# Python - instead of a system python we install mamba
RUN /bin/bash -c "curl -L https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh > mambaforge.sh && bash mambaforge.sh -b -p /opt/conda && rm mambaforge.sh"
ENV PATH=/opt/conda/bin:$PATH

WORKDIR /opt/ompi

# We can't build java ones
ENV PATH=/opt/ompi:$PATH
COPY ./Makefile ./Makefile
RUN make

RUN git clone https://github.com/LLNL/mpiGraph /opt/mpigraph
WORKDIR /opt/mpigraph
RUN make
ENV PATH=/opt/mpigraph:$PATH
147 changes: 147 additions & 0 deletions mpigraph/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2018 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2011-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc. All rights reserved.
# Copyright (c) 2017-2018 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# Use the Open MPI-provided wrapper compilers.

MPICC = mpicc
MPICXX = mpic++
MPIFC = mpifort
MPIJAVAC = mpijavac
SHMEMCC = shmemcc
SHMEMCXX = shmemc++
SHMEMFC = shmemfort

# Using -g is not necessary, but it is helpful for example programs,
# especially if users want to examine them with debuggers. Note that
# gmake requires the CXXFLAGS macro, while other versions of make
# (such as Sun's make) require the CCFLAGS macro.

CFLAGS += -g
CXXFLAGS += -g
CCFLAGS += -g
FCFLAGS += -g

# Example programs to build

EXAMPLES = \
hello_c \
hello_cxx \
hello_mpifh \
hello_usempi \
hello_usempif08 \
hello_oshmem \
hello_oshmemcxx \
hello_oshmemfh \
ring_c \
ring_cxx \
ring_mpifh \
ring_usempi \
ring_usempif08 \
ring_oshmem \
ring_oshmemfh \
connectivity_c \
oshmem_shmalloc \
oshmem_circular_shift \
oshmem_max_reduction \
oshmem_strided_puts \
oshmem_symmetric_data \
spc_example


# Default target. Always build the C MPI examples. Only build the
# others if we have the appropriate Open MPI / OpenSHMEM language
# bindings.

all: hello_c ring_c connectivity_c spc_example
$(MAKE) mpi;

# MPI examples

mpi:
$(MAKE) hello_cxx ring_cxx;
$(MAKE) hello_mpifh ring_mpifh;
$(MAKE) hello_usempi ring_usempi;

# The usual "clean" target

clean:
rm -f $(EXAMPLES) *~ *.o

# Don't rely on default rules for the Fortran and Java examples

hello_c: hello_c.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
ring_c: ring_c.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
connectivity_c: connectivity_c.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
spc_example: spc_example.c
$(MPICC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

hello_cxx: hello_cxx.cc
$(MPICXX) $(CXXFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
ring_cxx: ring_cxx.cc
$(MPICXX) $(CXXFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

hello_mpifh: hello_mpifh.f
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
ring_mpifh: ring_mpifh.f
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

hello_usempi: hello_usempi.f90
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
ring_usempi: ring_usempi.f90
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

hello_usempif08: hello_usempif08.f90
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
ring_usempif08: ring_usempif08.f90
$(MPIFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

hello_oshmem: hello_oshmem_c.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
hello_oshmemcxx: hello_oshmem_cxx.cc
$(SHMEMCXX) $(CXXFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
hello_oshmemfh: hello_oshmemfh.f90
$(SHMEMFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

ring_oshmem: ring_oshmem_c.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
ring_oshmemfh: ring_oshmemfh.f90
$(SHMEMFC) $(FCFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

oshmem_shmalloc: oshmem_shmalloc.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

oshmem_circular_shift: oshmem_circular_shift.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

oshmem_max_reduction: oshmem_max_reduction.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

oshmem_strided_puts: oshmem_strided_puts.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@

oshmem_symmetric_data: oshmem_symmetric_data.c
$(SHMEMCC) $(CFLAGS) $(LDFLAGS) $? $(LDLIBS) -o $@
6 changes: 6 additions & 0 deletions mpigraph/uptodate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dockerbuild:
build_args:
tag:
key: tag
versions:
- jammy
Loading