Added cuda as a build option for mpi-linux-x86_64 builds of charm++.
authorLukasz Wesolowski <wesolwsk@illinois.edu>
Thu, 15 Dec 2011 07:40:31 +0000 (01:40 -0600)
committerLukasz Wesolowski <wesolwsk@illinois.edu>
Thu, 15 Dec 2011 07:40:31 +0000 (01:40 -0600)
src/arch/mpi-linux-x86_64/Makefile.machine [new file with mode: 0644]
src/arch/mpi-linux-x86_64/conv-mach-cuda.h [new file with mode: 0644]
src/arch/mpi-linux-x86_64/conv-mach-cuda.sh [new file with mode: 0644]
src/arch/mpi-linux-x86_64/special.sh [new file with mode: 0755]

diff --git a/src/arch/mpi-linux-x86_64/Makefile.machine b/src/arch/mpi-linux-x86_64/Makefile.machine
new file mode 100644 (file)
index 0000000..3fbc672
--- /dev/null
@@ -0,0 +1,10 @@
+BUILD_GPU_MANAGER=$(shell CHARMINC=.; if test -f ./conv-config.sh; then . ./conv-config.sh; echo $$BUILD_CUDA; fi )
+
+ifeq "$(BUILD_GPU_MANAGER)" "1"
+hybridAPI: 
+          cd hybridAPI && make install
+
+charm++: hybridAPI
+
+.PHONY: hybridAPI
+endif
\ No newline at end of file
diff --git a/src/arch/mpi-linux-x86_64/conv-mach-cuda.h b/src/arch/mpi-linux-x86_64/conv-mach-cuda.h
new file mode 100644 (file)
index 0000000..9a190de
--- /dev/null
@@ -0,0 +1,7 @@
+#undef  CMK_CUDA
+#define CMK_CUDA                                           1
+
+#undef CMK_WHEN_PROCESSOR_IDLE_BUSYWAIT
+#define CMK_WHEN_PROCESSOR_IDLE_BUSYWAIT                   1
+#undef CMK_WHEN_PROCESSOR_IDLE_USLEEP
+#define CMK_WHEN_PROCESSOR_IDLE_USLEEP                     0
diff --git a/src/arch/mpi-linux-x86_64/conv-mach-cuda.sh b/src/arch/mpi-linux-x86_64/conv-mach-cuda.sh
new file mode 100644 (file)
index 0000000..8319cd3
--- /dev/null
@@ -0,0 +1,5 @@
+BUILD_CUDA=1
+CMK_INCDIR="-I$CUDA_DIR/include $CMK_INCDIR "
+CMK_LIBDIR="-L$CUDA_DIR/lib64 $CMK_LIBDIR "
+CMK_LIBS="-lcuda -lcudart -lcudahybridapi $CMK_LIBS "
+
diff --git a/src/arch/mpi-linux-x86_64/special.sh b/src/arch/mpi-linux-x86_64/special.sh
new file mode 100755 (executable)
index 0000000..e239964
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+export CHARMINC=../include
+. ./conv-config.sh
+
+if test -n "$BUILD_CUDA"
+then
+  echo "---------------------- special.sh for cuda executing ----------------"
+
+  ./gathertree ../../src/arch/cuda .
+
+# make links
+  test ! -f "../include/cuda-hybrid-api.h" && ./system_ln "../tmp/hybridAPI/cuda-hybrid-api.h" ../include && test ! -f "../include/wr.h" && ./system_ln "../tmp/hybridAPI/wr.h" ../include && test ! -f "../include/wrqueue.h" && ./system_ln "../tmp/hybridAPI/wrqueue.h" ../include
+
+#make library
+  export CHARMINC=../include
+  . ./conv-config.sh
+
+fi
\ No newline at end of file