#!/usr/bin/env bash # Copyright (C) 2022 by Alejandro Gallo set -eu flags=("${@}") PROJECTS=() ############################################################ # ## Check root directory # root_project=$(git rev-parse --show-toplevel) configure=$root_project/configure if [[ $(basename $PWD) == $(basename $root_project) ]]; then cat < creating: $name" cat < configure #!/usr/bin/env bash # creator: $0 # date: $(date) $root_project/configure $(cat $file | paste -s) \\ $(for word in "${flags[@]}"; do printf " \"%s\"" "$word"; done) exit 0 SH chmod +x configure cd - > /dev/null } ############################################################ # begin doc # # - default :: # This configuration uses a CPU code with dgemm # and without computing slices. # # end doc tmp=`mktemp` cat < $tmp --disable-slice EOF create_config $tmp default rm $tmp # begin doc # # - only-dgemm :: # This only runs the computation part that involves dgemms. # # end doc tmp=`mktemp` cat < $tmp --disable-slice --enable-only-dgemm EOF create_config $tmp only-dgemm rm $tmp # begin doc # # - cuda-only-dgemm :: # This is the naive CUDA implementation compiling only the dgemm parts # of the compute. # # end doc tmp=`mktemp` cat < $tmp --enable-cuda --enable-only-dgemm --disable-slice EOF create_config $tmp cuda-only-dgemm rm $tmp # begin doc # # - cuda-slices-on-gpu-only-dgemm :: # This configuration tests that slices reside completely on the gpu # and it should use a CUDA aware MPI implementation. # It also only uses the routines that involve dgemm. # # end doc tmp=`mktemp` cat < $tmp --enable-cuda --enable-sources-in-gpu --enable-cuda-aware-mpi --enable-only-dgemm --disable-slice EOF create_config $tmp cuda-slices-on-gpu-only-dgemm rm $tmp ############################################################ # ## Create makefile # cat < Makefile all: configure do do: configure configure: ${PROJECTS[@]/%/\/Makefile} %/Makefile: %/configure cd \$* && ./configure do: ${PROJECTS[@]/%/\/src\/libatrip.a} %/src/libatrip.a: cd \$* && \$(MAKE) .PHONY: configure do all MAKE cat <