Loading OpenARCSetup.bash +1 −0 Original line number Diff line number Diff line Loading @@ -4,4 +4,5 @@ module load cuda module load pgi module load cudampi export openarc=/scratch/${USER}/local/openarc export openarcexamples=scratch/${USER}/local/openarcexamples README.md +51 −9 Original line number Diff line number Diff line Loading @@ -19,14 +19,17 @@ ENVIRONMENT SETUP ------------------------------------------------------------------------------- * Module Setting - Load the following modules: java, cuda, pgi, and cudampi (Run the commands below.) //Run the commands below: $ module load java $ module load cuda $ module load pgi $ module cudampi //Or run the following command: $ source /home01/kedu01/shared/OpenARCSetup.bash * OpenARC Environment Setting - Set the following environment variables: - Set the following environment variables (targeting NVIDIA CUDA GPUs): $ export OPENARC_ARCH=0 //Optional setting to use CUDA Unified Memory $ export OPENARCRT_UNIFIEDMEM=1 Loading @@ -38,9 +41,12 @@ ENVIRONMENT SETUP $ /home01/kedu01/shared/installOpenARC.bash - Set environment variable, openarc, to the OpenARC install directory: $ export openarc=$HOME/local/openarc $ export openarc=/scratch/${USER}/local/openarc * Additional Settings for example tests - Set environment variable, openarcexamples to the root directory containing the OpenARC examples $ export openarcexamples=scratch/${USER}/local/openarcexamples - If an input OpenACC program uses OpenMP, set environment variable, OMP_NUM_THREADS. $ export OMP_NUM_THREADS=10 Loading @@ -48,18 +54,54 @@ ENVIRONMENT SETUP $ export mpiinclude=/apps/compiler/pgi/linux86-64/19.1/cudampi/10.0/openmpi/3.1.0/include ------------------------------------------------------------------------------- EXAMPLE TESTING COMPILE & RUN EXAMPLES ------------------------------------------------------------------------------- * To compile and run the examples in the openarcexamples directory, visit each example directory and run the following steps. - Run the OpenARC compiler (e.g., matmul example): //Go to openarcexamples directory. $ cd ./matmal $ ./O2GBuild.bash $ cd ${openarcexamples}/matmal $ ./O2GBuild.script - Compile OpenARC-generated output files: $ make - To submit the output program: - To submit a job to run the output program: $ cd bin; sbatch gpu.sh ------------------------------------------------------------------------------- EXPERIMENTS ------------------------------------------------------------------------------- * Experiment1: learn how to compile and run the matmul benchmark. - Task1: compile and run matmul $ cd ${openarcexamples}/matmul //Run the OpenARC compiler. $ ./O2GBuild.script //Check generated output files. $ vi ./cetus_output/openarc_kernel.cu $ vi ./cetus_output/matmul.cpp //Compile the generated output files. $ make //Submit a job to run the output program. $ cd bin; sbatch gpu.sh - Task2: learn how to use an OpenARC commandline option: showInternalAnnotations $ cd ${openarcexamples}/matmul //Open the OpenARC configuration file and set showInternalAnnotations to 1 (e.g., showInternalAnnotations=1) $ vi ./matmul/openarcConf.txt //Run O2GBuild.script script again. $ ./O2GBuild.script //Check generated output files $ vi ./cetus_output/openarc_kernel.cu $ vi ./cetus_output/matmul.cpp //Repeat the above steps by changing showInternalAnnotations up to 3. - Task3: learn how to use commandline options for caching optimizations: shrdArryCachingOnTM $ cd ${openarcexamples}/matmul //Open the OpenARC configuration file and set shrdArryCachingOnTM to 1 (e.g., shrdArryCachingOnTM=1) $ vi ./matmul/openarcConf.txt //Run O2GBuild.script script again. $ ./O2GBuild.script //Check generated output files $ vi ./cetus_output/openarc_kernel.cu $ vi ./cetus_output/matmul.cpp Loading
OpenARCSetup.bash +1 −0 Original line number Diff line number Diff line Loading @@ -4,4 +4,5 @@ module load cuda module load pgi module load cudampi export openarc=/scratch/${USER}/local/openarc export openarcexamples=scratch/${USER}/local/openarcexamples
README.md +51 −9 Original line number Diff line number Diff line Loading @@ -19,14 +19,17 @@ ENVIRONMENT SETUP ------------------------------------------------------------------------------- * Module Setting - Load the following modules: java, cuda, pgi, and cudampi (Run the commands below.) //Run the commands below: $ module load java $ module load cuda $ module load pgi $ module cudampi //Or run the following command: $ source /home01/kedu01/shared/OpenARCSetup.bash * OpenARC Environment Setting - Set the following environment variables: - Set the following environment variables (targeting NVIDIA CUDA GPUs): $ export OPENARC_ARCH=0 //Optional setting to use CUDA Unified Memory $ export OPENARCRT_UNIFIEDMEM=1 Loading @@ -38,9 +41,12 @@ ENVIRONMENT SETUP $ /home01/kedu01/shared/installOpenARC.bash - Set environment variable, openarc, to the OpenARC install directory: $ export openarc=$HOME/local/openarc $ export openarc=/scratch/${USER}/local/openarc * Additional Settings for example tests - Set environment variable, openarcexamples to the root directory containing the OpenARC examples $ export openarcexamples=scratch/${USER}/local/openarcexamples - If an input OpenACC program uses OpenMP, set environment variable, OMP_NUM_THREADS. $ export OMP_NUM_THREADS=10 Loading @@ -48,18 +54,54 @@ ENVIRONMENT SETUP $ export mpiinclude=/apps/compiler/pgi/linux86-64/19.1/cudampi/10.0/openmpi/3.1.0/include ------------------------------------------------------------------------------- EXAMPLE TESTING COMPILE & RUN EXAMPLES ------------------------------------------------------------------------------- * To compile and run the examples in the openarcexamples directory, visit each example directory and run the following steps. - Run the OpenARC compiler (e.g., matmul example): //Go to openarcexamples directory. $ cd ./matmal $ ./O2GBuild.bash $ cd ${openarcexamples}/matmal $ ./O2GBuild.script - Compile OpenARC-generated output files: $ make - To submit the output program: - To submit a job to run the output program: $ cd bin; sbatch gpu.sh ------------------------------------------------------------------------------- EXPERIMENTS ------------------------------------------------------------------------------- * Experiment1: learn how to compile and run the matmul benchmark. - Task1: compile and run matmul $ cd ${openarcexamples}/matmul //Run the OpenARC compiler. $ ./O2GBuild.script //Check generated output files. $ vi ./cetus_output/openarc_kernel.cu $ vi ./cetus_output/matmul.cpp //Compile the generated output files. $ make //Submit a job to run the output program. $ cd bin; sbatch gpu.sh - Task2: learn how to use an OpenARC commandline option: showInternalAnnotations $ cd ${openarcexamples}/matmul //Open the OpenARC configuration file and set showInternalAnnotations to 1 (e.g., showInternalAnnotations=1) $ vi ./matmul/openarcConf.txt //Run O2GBuild.script script again. $ ./O2GBuild.script //Check generated output files $ vi ./cetus_output/openarc_kernel.cu $ vi ./cetus_output/matmul.cpp //Repeat the above steps by changing showInternalAnnotations up to 3. - Task3: learn how to use commandline options for caching optimizations: shrdArryCachingOnTM $ cd ${openarcexamples}/matmul //Open the OpenARC configuration file and set shrdArryCachingOnTM to 1 (e.g., shrdArryCachingOnTM=1) $ vi ./matmul/openarcConf.txt //Run O2GBuild.script script again. $ ./O2GBuild.script //Check generated output files $ vi ./cetus_output/openarc_kernel.cu $ vi ./cetus_output/matmul.cpp