FROM nlknguyen/alpine-mpich:onbuild

# # ------------------------------------------------------------
# # Build MPI project
# # ------------------------------------------------------------

# Put all build steps and additional package installation here

# Note: the current directory is ${WORKDIR:=/project}, which is
# also the default directory where ${USER:=mpi} will SSH login to

# Copy the content of `project` directory in the host machine to 
# the current working directory in this Docker image
COPY project/ .
COPY PPFLAB/  .

# Normal build command
RUN mpicc -o mpi_hello_world mpi_hello_world.c
RUN mpicc -O3 -o mmxmpi mmxmpi.c


######### HELLO-MPI EXAMPLE ########

#RUN mpicc -O3 -o hello_mpi hello_mpi.c


######### COURSE EXAMPLES ########
#RUN mpicc -O3 -o mpi-get-count mpi-get-count.c
#RUN mpicc -O3 -o mpi-async mpi-async.c
#RUN mpicc -O3 -o mpi-trap0 mpi-trap0.c
#RUN mpicc -O3 -o mpi-trap1 mpi-trap1.c
#RUN mpicc -O3 -o mpi-minloc mpi-minloc.c
#RUN mpicc -O3 -o mpi-scan mpi-scan.c
#RUN mpicc -O3 -o mpi-odd-even mpi-odd-even.c
#RUN mpicc -O3 -o mpi-odd-even2 mpi-odd-even2.c
#RUN mpicc -O3 -o mpi-type-contiguous mpi-type-contiguous.c
#RUN mpicc -O3 -o mpi-type-struct mpi-type-struct.c
#RUN mpicc -O3 -o mpi-type-indexed mpi-type-indexed.c
#RUN mpicc -O3 -o mpi-type-vector mpi-type-vector.c
#RUN mpicc -O3 -o mpi-vecvec mpi-vecvec.c


######## MPI TASK ########

RUN mpicc -O3 -o fibxmpich fibxmpich.c



# ####################
# For Docker beginner:

# After Docker syntax `RUN`, you can execute any command available in 
# the current shell of the image.

# To switch to root:    USER root
# To switch back to default user: USER ${USER}
