From 174149e2364a294b3a0d6859af15d831f0ce533c Mon Sep 17 00:00:00 2001 From: "Xinsheng (Shawn) Qin" Date: Tue, 3 Mar 2020 00:31:19 -0800 Subject: [PATCH] update Makefile in GPU examples to set default values for CUDA relevant variables --- examples/GPU/acoustics_2d_adjoint/Makefile | 13 ++++--------- .../GPU/acoustics_2d_heterogeneous_radial/Makefile | 13 ++++--------- .../GPU/acoustics_2d_homogeneous_radial/Makefile | 13 ++++--------- examples/GPU/shallow_water_no_topography/Makefile | 13 ++++--------- .../GPU/shallow_water_topo_bowl_radial/Makefile | 12 ++++-------- .../GPU/shallow_water_topo_flat_bottom/Makefile | 12 ++++-------- 6 files changed, 24 insertions(+), 52 deletions(-) diff --git a/examples/GPU/acoustics_2d_adjoint/Makefile b/examples/GPU/acoustics_2d_adjoint/Makefile index 1755a55e1..e6328d994 100644 --- a/examples/GPU/acoustics_2d_adjoint/Makefile +++ b/examples/GPU/acoustics_2d_adjoint/Makefile @@ -22,26 +22,24 @@ PLOTDIR = _plots # Directory for plots OVERWRITE ?= True # False ==> make a copy of OUTDIR first RESTART ?= False # Should = clawdata.restart in setrun -FC = pgi USE_CUDA = TRUE -# FC = gfortran -# USE_CUDA = FALSE +FC = pgi +CUDA_PATH ?= /usr/local/cuda-10.0 +CUDA_VERSION ?= 10.0 +CUDA_CC ?= cc60 -# DEBUG = TRUE DEBUG = FALSE CC = pgi USE_CPP = TRUE PROFILE = TRUE -# PROFILE = FALSE USE_OPENMP = TRUE VERBOSE = FALSE -# USE_DOUBLE_PRECISION = FALSE USE_DOUBLE_PRECISION = TRUE DIM = 2 @@ -51,9 +49,6 @@ NUM_COEFFS = 0 USE_FWAVES = FALSE USE_CAPA = FALSE -# Environment variable FC should be set to fortran compiler, e.g. gfortran - - # Compiler flags can be specified here or set as an environment variable FFLAGS ?= diff --git a/examples/GPU/acoustics_2d_heterogeneous_radial/Makefile b/examples/GPU/acoustics_2d_heterogeneous_radial/Makefile index e16741629..52fc5dd60 100644 --- a/examples/GPU/acoustics_2d_heterogeneous_radial/Makefile +++ b/examples/GPU/acoustics_2d_heterogeneous_radial/Makefile @@ -21,26 +21,24 @@ PLOTDIR = _plots # Directory for plots OVERWRITE ?= True # False ==> make a copy of OUTDIR first -FC = pgi USE_CUDA = TRUE -# FC = gfortran -# USE_CUDA = FALSE +FC = pgi +CUDA_PATH ?= /usr/local/cuda-10.0 +CUDA_VERSION ?= 10.0 +CUDA_CC ?= cc60 -# DEBUG = TRUE DEBUG = FALSE CC = pgi USE_CPP = TRUE PROFILE = TRUE -# PROFILE = FALSE USE_OPENMP = TRUE VERBOSE = FALSE -# USE_DOUBLE_PRECISION = FALSE USE_DOUBLE_PRECISION = TRUE DIM = 2 @@ -50,9 +48,6 @@ NUM_COEFFS = 2 USE_FWAVES = FALSE USE_CAPA = FALSE -# Environment variable FC should be set to fortran compiler, e.g. gfortran - - # Compiler flags can be specified here or set as an environment variable FFLAGS ?= diff --git a/examples/GPU/acoustics_2d_homogeneous_radial/Makefile b/examples/GPU/acoustics_2d_homogeneous_radial/Makefile index dacc2dd05..aa8738286 100644 --- a/examples/GPU/acoustics_2d_homogeneous_radial/Makefile +++ b/examples/GPU/acoustics_2d_homogeneous_radial/Makefile @@ -21,26 +21,24 @@ PLOTDIR = _plots # Directory for plots OVERWRITE ?= True # False ==> make a copy of OUTDIR first -FC = pgi USE_CUDA = TRUE -# FC = gfortran -# USE_CUDA = FALSE +FC = pgi +CUDA_PATH ?= /usr/local/cuda-10.0 +CUDA_VERSION ?= 10.0 +CUDA_CC ?= cc60 -# DEBUG = TRUE DEBUG = FALSE CC = pgi USE_CPP = TRUE PROFILE = TRUE -# PROFILE = FALSE USE_OPENMP = TRUE VERBOSE = FALSE -# USE_DOUBLE_PRECISION = FALSE USE_DOUBLE_PRECISION = TRUE DIM = 2 @@ -50,9 +48,6 @@ NUM_COEFFS = 0 USE_FWAVES = FALSE USE_CAPA = FALSE -# Environment variable FC should be set to fortran compiler, e.g. gfortran - - # Compiler flags can be specified here or set as an environment variable FFLAGS ?= diff --git a/examples/GPU/shallow_water_no_topography/Makefile b/examples/GPU/shallow_water_no_topography/Makefile index 594e88d13..373b0f58f 100644 --- a/examples/GPU/shallow_water_no_topography/Makefile +++ b/examples/GPU/shallow_water_no_topography/Makefile @@ -21,26 +21,24 @@ PLOTDIR = _plots # Directory for plots OVERWRITE ?= True # False ==> make a copy of OUTDIR first -FC = pgi USE_CUDA = TRUE -# FC = gfortran -# USE_CUDA = FALSE +FC = pgi +CUDA_PATH ?= /usr/local/cuda-10.0 +CUDA_VERSION ?= 10.0 +CUDA_CC ?= cc60 -# DEBUG = TRUE DEBUG = FALSE CC = pgi USE_CPP = TRUE PROFILE = TRUE -# PROFILE = FALSE USE_OPENMP = TRUE VERBOSE = FALSE -# USE_DOUBLE_PRECISION = FALSE USE_DOUBLE_PRECISION = TRUE DIM = 2 @@ -50,9 +48,6 @@ NUM_COEFFS = 0 USE_FWAVES = FALSE USE_CAPA = FALSE -# Environment variable FC should be set to fortran compiler, e.g. gfortran - - # Compiler flags can be specified here or set as an environment variable FFLAGS ?= diff --git a/examples/GPU/shallow_water_topo_bowl_radial/Makefile b/examples/GPU/shallow_water_topo_bowl_radial/Makefile index 0e47bf7c2..05d9d81e0 100644 --- a/examples/GPU/shallow_water_topo_bowl_radial/Makefile +++ b/examples/GPU/shallow_water_topo_bowl_radial/Makefile @@ -21,26 +21,24 @@ PLOTDIR = _plots # Directory for plots OVERWRITE ?= True # False ==> make a copy of OUTDIR first -FC = pgi USE_CUDA = TRUE -# FC = gfortran -# USE_CUDA = FALSE +FC = pgi +CUDA_PATH ?= /usr/local/cuda-10.0 +CUDA_VERSION ?= 10.0 +CUDA_CC ?= cc60 -# DEBUG = TRUE DEBUG = FALSE CC = pgi USE_CPP = TRUE PROFILE = TRUE -# PROFILE = FALSE USE_OPENMP = TRUE VERBOSE = FALSE -# USE_DOUBLE_PRECISION = FALSE USE_DOUBLE_PRECISION = TRUE DIM = 2 @@ -49,8 +47,6 @@ NUM_WAVES = 3 NUM_COEFFS = 1 USE_FWAVES = TRUE -# Environment variable FC should be set to fortran compiler, e.g. gfortran - # Compiler flags can be specified here or set as an environment variable FFLAGS ?= diff --git a/examples/GPU/shallow_water_topo_flat_bottom/Makefile b/examples/GPU/shallow_water_topo_flat_bottom/Makefile index 82c7745e8..e2557a3f6 100644 --- a/examples/GPU/shallow_water_topo_flat_bottom/Makefile +++ b/examples/GPU/shallow_water_topo_flat_bottom/Makefile @@ -21,26 +21,24 @@ PLOTDIR = _plots # Directory for plots OVERWRITE ?= True # False ==> make a copy of OUTDIR first -FC = pgi USE_CUDA = TRUE -# FC = gfortran -# USE_CUDA = FALSE +FC = pgi +CUDA_PATH ?= /usr/local/cuda-10.0 +CUDA_VERSION ?= 10.0 +CUDA_CC ?= cc60 -# DEBUG = TRUE DEBUG = FALSE CC = pgi USE_CPP = TRUE PROFILE = TRUE -# PROFILE = FALSE USE_OPENMP = TRUE VERBOSE = FALSE -# USE_DOUBLE_PRECISION = FALSE USE_DOUBLE_PRECISION = TRUE DIM = 2 @@ -49,8 +47,6 @@ NUM_WAVES = 3 NUM_COEFFS = 1 USE_FWAVES = TRUE -# Environment variable FC should be set to fortran compiler, e.g. gfortran - # Compiler flags can be specified here or set as an environment variable FFLAGS ?=