From 2c23b1d3781f7c5203d69e38c1529dbbe419a802 Mon Sep 17 00:00:00 2001
From: Nicolas Ducarton <nicolas.ducarton@inria.fr>
Date: Wed, 20 Nov 2024 14:20:10 +0100
Subject: [PATCH] more scripts

---
 build.sh             |   3 ++-
 launch-test.sh       |  62 ++++++++++++++++++++++++++++++++++++-------
 mpi4/.Dockerfile.un~ | Bin 1174 -> 0 bytes
 mpi4/Dockerfile      |  28 +++++++++++++++----
 mpi5/Dockerfile      |  28 ++++++++++++-------
 mpich/Dockerfile     |   2 +-
 6 files changed, 98 insertions(+), 25 deletions(-)
 mode change 100644 => 100755 launch-test.sh
 delete mode 100644 mpi4/.Dockerfile.un~

diff --git a/build.sh b/build.sh
index d0e391c..2e15fcd 100644
--- a/build.sh
+++ b/build.sh
@@ -2,5 +2,6 @@ cd starpu
 ./autogen.sh > ../autogen_result 2>&1 
 mkdir ../build
 cd ../build
-../starpu/configure --prefix=/home/install --disable-cuda --enable-mpi --disable-opencl --disable-starpupy --enable-mpi-ft --enable-mpi-check --enable-mpi-ft-stats > ../configure_result  2>&1 
+../starpu/configure --prefix=/home/starpu/install --disable-cuda --enable-mpi --disable-opencl --disable-starpupy --enable-mpi-ft --enable-mpi-check --enable-mpi-ft-stats > ../configure_result  2>&1 
 make -j  > ../make_result  2>&1
+make install
diff --git a/launch-test.sh b/launch-test.sh
old mode 100644
new mode 100755
index c86e6ed..256b5d1
--- a/launch-test.sh
+++ b/launch-test.sh
@@ -1,30 +1,57 @@
 #get fist param, help, check, build
 p=${1-unset}
+g=${2-unset}
 #print help
 HELP (){
-	echo "usage: ./launch-test help/check/build";
+	echo "It is recommended that you provide a symbolic link named starpu to the starpu repository";
+	echo " ln -s <path_to_starpu> starpu\n";
+
+	echo "usage: ./launch-test <config> <action> [type] [path]";
+	echo "config: ";
+	echo "\t all : launch on all available configs";
+	echo "\t config name : launch on this particular docker config (a folder with that name containing a dockerfile must exist)";
+	echo "action: ";
 	echo "\t help: print this";
 	echo "\t check: build starpu and run tests";
 	echo "\t build: only build starpu";
+	echo "\t run : run [type] located at [path] (they must be provided)";
+	echo "\t\t type : script or (test (TODO))";
+	echo "\t\t path : path to script (or test name (TODO))";
+	echo "\t TODO gdb interactive guest_script/host_script";
+	echo "\t TODO : remove all created images";
 }
 GETPU(){
 #if starpu folder does not exist clone
 if [ ! -d "starpu" ]
 then
+	echo "starpu not found in working directory, cloning from git";
 	git clone https://gitlab.inria.fr/starpu/starpu.git -b ft_ulfm
 fi
 }
 RUN(){
 	if [ ! -d "docker_results" ]
 	then
-		mkdir docker_results
+		mkdir docker_results;
+	fi
+	if [ $p = 'all' ]
+	then
+		#differenciate all / a config
+		docker build mpi5/ > docker_results/docker_build_mpi5
+		docker run mpi5 > docker_results/docker_run_mpi5 
+		docker build mpi4/ > docker_results/docker_build_mpi4
+		docker run mpi4 > docker_results/docker_run_mpi4
+		docker build mpich/ > docker_results/docker_build_mpich
+		docker run mpich > docker_results/docker_run_mpich
+	elif [ $p = 'unset' ]
+	then 
+		HELP
+	else
+		#check that it exists
+		docker build $p > docker_results/docker_build_$p
+		docker run $p >  docker_results/docker_run_$p
+		docker rm $(docker stop $(docker ps -a -q --filter ancestor=$p:latest --format="{{.ID}}"))
+		#remove image?
 	fi
-	docker build mpi5/ > docker_results/docker_build_mpi5
-	docker run mpi5 > docker_results/docker_run_mpi5
-	docker build mpi4/ > docker_results/docker_build_mpi4
-	docker run mpi4 > docker_results/docker_run_mpi4
-	docker build mpich/ > docker_results/docker_build_mpich
-	docker run mpich > docker_results/docker_run_mpich
 }
 if [ $g = 'help' ]
 then
@@ -34,9 +61,26 @@ then
 	GETPU
 	cp check.sh run.sh
 	RUN
-elif
+elif [ $g = 'build' ]
 then
 	GETPU
 	cp build.sh run.sh
 	RUN
+elif [ $g = 'run' ]
+then
+	GETPU
+	st=${3-unset}
+	path=${4-unset}
+	if [ $st = 'script' ]
+	then 
+		if [ $path = 'unset' ]
+		then
+			echo "Please provide a path for the script you want to run";
+		else
+			cp $path run.sh
+			RUN
+		fi
+	fi
+	#Do for a particular test
+	
 fi
diff --git a/mpi4/.Dockerfile.un~ b/mpi4/.Dockerfile.un~
deleted file mode 100644
index 5ed7ac18aaa3dfe4e60d4640306db98730185bb6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1174
zcmWH`%$*;a=aT=Ffr(Y&-;eon+ZR2%ZrB(9Y5$hV9Y3WU%3D$*mq+|H;<l_|U|^7C
zKn08p3=B+AArKA24C$tS->`sW85!a)ASr+{89-8OFwXz~|NnzUU;?8wl|vxi^zSop
zbTBY{m0)0C00lh<0|SEs0|O-BQAFiIwwpGBBMuZ%ATA7pVi=@T6C^MiaiCD3B~CZ}
z`x+c^jF5<9XJB9e1wY76W(Ed^z@Sh+h4S>&5`~PCl7eC@ef^aD^1Ph<#1y^!g48_S
z+=5KK{GxRIqSTz!#Nt$an4o@{sh$Ctms^mjYpQ3UXR23{SfrO;#lXN|1v0cGu}GmJ
zO#!3<U5SF4nnF=7Rw)Js278e1<P=nCeUKhK{p9?-w9NF<qErw!H!(X^K{pG|%*-n;
MNzBPHZG6580GtSK_5c6?

diff --git a/mpi4/Dockerfile b/mpi4/Dockerfile
index d9a3966..0fe5438 100644
--- a/mpi4/Dockerfile
+++ b/mpi4/Dockerfile
@@ -2,13 +2,31 @@ FROM debian:12
 WORKDIR /home
 # Install starpu dependencies
 RUN apt update && apt upgrade
-RUN apt install g++ make libtool git libopenblas-dev libhwloc-dev pkg-config texlive texlive-font-utils doxygen libtool-bin texlive-fonts-extra -y
+RUN apt-get install -y \
+    sudo \
+    git  \
+    autoconf \
+    automake \
+    build-essential \
+    libtool-bin \
+    libhwloc-dev \
+    pkg-config \
+    gdb \
+    vim \
+    libopenblas-pthread-dev \
+		wget
 # Install mpi version
-RUN apt install libopenmpi-dev openmpi-bin
-
+#RUN apt install libopenmpi-dev openmpi-bin
+RUN wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.3.tar.gz
+RUN tar xf openmpi-4.1.3.tar.gz && rm openmpi-4.1.3.tar.gz
+RUN cd openmpi-4.1.3/ && ./configure && make -j && make install
 #So we don't run mpi as root
-RUN useradd app
-USER app
+RUN useradd starpu
+USER starpu
+
+RUN mkdir /home/starpu
+WORKDIR /home/starpu
+COPY starpu starpu
 
 #clone starpu and build
 #RUN git clone https://gitlab.inria.fr/starpu/starpu.git -b ft_ulfm
diff --git a/mpi5/Dockerfile b/mpi5/Dockerfile
index 4557245..aa855ba 100644
--- a/mpi5/Dockerfile
+++ b/mpi5/Dockerfile
@@ -2,24 +2,34 @@ FROM debian:12
 WORKDIR /home
 # Install starpu dependencies
 RUN apt update && apt upgrade
-RUN apt install g++ make libtool git libopenblas-dev libhwloc-dev pkg-config texlive texlive-font-utils doxygen libtool-bin texlive-fonts-extra -y
+RUN apt-get install -y \
+    sudo \
+    git  \
+    autoconf \
+    automake \
+    build-essential \
+    libtool-bin \
+    libhwloc-dev \
+    pkg-config \
+    gdb \
+    vim \
+    libopenblas-pthread-dev \
+		wget \
+		python3.11-full
 # Install mpi version
 RUN wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz
 RUN tar xf openmpi-5.0.5.tar.gz && rm openmpi-5.0.5.tar.gz
 RUN cd openmpi-5.0.5/ && ./configure && make -j && make install
+RUN mkdir /home/starpu
 
 #So we don't run mpi as root
-RUN useradd app
-USER app
+RUN useradd starpu
+USER starpu
 
-#clone starpu and build
-#RUN git clone https://gitlab.inria.fr/starpu/starpu.git -b ft_ulfm
-COPY starpu starpu
+WORKDIR /home/starpu
+ADD ./starpu /home/starpu/starpu
 #run whatever the script gave us
 COPY run.sh .
-#RUN mkdir build && cd build
-#RUN ../starpu/configure --prefix=../install --disable-cuda --enable-mpi --disable-opencl --disable-starpupy --enable-mpi-ft --enable-mpi-check --enable-mpi-ft-stats > ../configure_result  2>&1 &
-#RUN make -j  > ~/make_result  2>&1 &
 CMD ["./run.sh"]
 
 
diff --git a/mpich/Dockerfile b/mpich/Dockerfile
index 9b66d0a..de48a93 100644
--- a/mpich/Dockerfile
+++ b/mpich/Dockerfile
@@ -16,7 +16,7 @@ RUN apt-get install -y \
     libopenblas-pthread-dev
 
 # Install mpi version
-RUN apt install mpich
+RUN apt install -y mpich
 
 #So we don't run mpi as root
 RUN useradd starpu
-- 
GitLab