charmc: Integrate support for ROSE/OpenMP-based AMPI global variable privatization
authorPhil Miller <mille121@illinois.edu>
Thu, 12 Sep 2013 19:58:01 +0000 (12:58 -0700)
committerPhil Miller <mille121@illinois.edu>
Thu, 12 Sep 2013 20:02:18 +0000 (13:02 -0700)
examples/ampi/Cjacobi3D/Makefile
src/scripts/charmc

index 1d32e2ef19f3d63c4b683caeeffb73a91c8af9df..b14f1bc701943637786e941818b4c80b7be561e2 100644 (file)
@@ -25,6 +25,10 @@ jacobi.tls: jacobi.C
        -$(CHARMC) -c -tlsglobal jacobi.C -o jacobi.tls.o 
        -$(CHARMC) -o jacobi.tls jacobi.tls.o -tlsglobal -module CommonLBs #-memory isomalloc
 
+jacobi.rose: jacobi.C
+       $(CHARMC) -roseomptlsglobals -o jacobi.rose.o -c $<
+       $(CHARMC) -roseomptlsglobals -o $@ jacobi.rose.o -module CommonLBs
+
 jacobi-get: jacobi-get.C
        $(CHARMC) -c jacobi-get.C
        $(CHARMC) -o jacobi-get jacobi-get.o -module CommonLBs -lm
index 95163535c8037c9974aab6eda8aaf68a2fd8a859..088e6293ec62170d299d0136af2210261b744605 100755 (executable)
@@ -90,6 +90,7 @@ CHARM_SHARED="0"
 BUILD_SHARE="0"
 SWAPGLOBALS="0"
 TLSGLOBALS="0"
+ROSE_OMP_TLS_GLOBALS="no"
 
 TAU_MAKEFILE=Make.tau
 TAU_TRACE_MPI=1
@@ -503,6 +504,10 @@ do
                TLSGLOBALS="1"
                ;;
 
+       "-roseomptlsglobals")
+               ROSE_OMP_TLS_GLOBALS="yes"
+               ;;
+
        "-verbose")
                echo "Verbose mode set"
                VERBOSE=true
@@ -878,6 +883,17 @@ then
     fi
 fi
 
+if [ "$ROSE_OMP_TLS_GLOBALS" = "yes" ]
+then
+    USE_OPENMP="yes"
+    TLSGLOBALS="1"
+
+    if [ ! -x "$CMK_ROSE_OMP_TOOL" ]
+    then
+       Abort "The environment variable CMK_ROSE_OMP_TOOL must contain the path to a built binary of the ROSE OpenMP variable privatization tool"
+    fi
+fi
+
 if [ "$USE_OPENMP" = "yes" ]
 then
     [ -n "$VERBOSE" ] && echo OpenMP support enabled
@@ -1300,6 +1316,30 @@ do
                DESTO=""
        fi
        NU_OBJ=""
+
+       if [ "$ROSE_OMP_TLS_GLOBALS" = "yes" ]
+       then
+           case "$FILE" in
+               *.c)
+                   Do $CMK_ROSE_OMP_TOOL -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CC -c $FILE
+                   FILE="rose_$FILE"
+                   ;;
+               *.C|*.cc|*.cxx|*.cpp|*.c++)
+                   Do $CMK_ROSE_OMP_TOOL -I$CHARMINC $OPTS_CPP_INTERNAL $OPTS_CPP $OPTS_CXX -c $FILE
+                   FILE="rose_$FILE"
+                   ;;
+               *.f|*.F)
+                   Do $CMK_ROSE_OMP_TOOL -I$CHARMINC $OPTS_CPP $OPTS_F90 -c $FILE
+                   FILE="rose_$FILE"
+                   ;;
+               *.f90|*.F90)
+                   test -z "$PREPROCESS" && OPTS_F90="$OPTS_F90 -c"
+                   Do $CMK_ROSE_OMP_TOOL -I$CHARMINC $OPTS_CPP $OPTS_F90 $FILE
+                   FILE="rose_$FILE"
+                   ;;
+           esac
+       fi
+
        case "$FILE" in
        *.ci)
                 XIOPTS=$CMK_XIOPTS