Skip to content

Commit fa8e20f

Browse files
authored
Add Polaris to GNUMake (#2908)
1 parent bd5f6a9 commit fa8e20f

File tree

3 files changed

+88
-6
lines changed

3 files changed

+88
-6
lines changed

Tools/GNUMake/Make.defs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ else ifeq ($(USE_CUDA),TRUE)
757757
LINK_WITH_FORTRAN_COMPILER=TRUE
758758
endif
759759

760+
$(info Loading $(AMREX_HOME)/Tools/GNUMake/comps/nvcc.mak...)
760761
include $(AMREX_HOME)/Tools/GNUMake/comps/nvcc.mak
761762

762763
ifeq ($(USE_MPI),TRUE)
@@ -966,17 +967,17 @@ endif
966967
F90CACHE =
967968

968969
ifeq ($(TP_PROFILING),VTUNE)
969-
$(into Loading $(AMREX_HOME)/Tools/GNUMake/tools/Make.vtune
970+
$(info Loading $(AMREX_HOME)/Tools/GNUMake/tools/Make.vtune
970971
include $(AMREX_HOME)/Tools/GNUMake/tools/Make.vtune
971972
endif
972973

973974
ifeq ($(TP_PROFILING),CRAYPAT)
974-
$(into Loading $(AMREX_HOME)/Tools/GNUMake/tools/Make.craypat
975+
$(info Loading $(AMREX_HOME)/Tools/GNUMake/tools/Make.craypat
975976
include $(AMREX_HOME)/Tools/GNUMake/tools/Make.craypat
976977
endif
977978

978979
ifeq ($(TP_PROFILING),FORGE)
979-
$(into Loading $(AMREX_HOME)/Tools/GNUMake/tools/Make.forge
980+
$(info Loading $(AMREX_HOME)/Tools/GNUMake/tools/Make.forge
980981
include $(AMREX_HOME)/Tools/GNUMake/tools/Make.forge
981982
endif
982983

Tools/GNUMake/Make.machines

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ ifdef OLCF_ROCM_ROOT
6767
endif
6868
endif
6969

70-
ifeq ($(findstring theta, $(host_name)), theta)
71-
which_site := alcf
72-
which_computer := theta
70+
ifeq ($(findstring alcf.anl.gov, $(host_name)),alcf.anl.gov)
71+
ifeq ($(findstring theta, $(host_name)), theta)
72+
which_site := alcf
73+
which_computer := theta
74+
endif
75+
ifeq ($(findstring polaris, $(host_name)), polaris)
76+
which_site := alcf
77+
which_computer := polaris
78+
endif
7379
endif
7480

7581
ifeq ($(findstring sierra, $(host_name)), sierra)

Tools/GNUMake/sites/Make.alcf

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,78 @@ ifeq ($(which_computer),theta)
88
LIBRARIES += -lmpichf90
99
endif
1010
endif
11+
12+
ifeq ($(which_computer),$(filter $(which_computer),polaris))
13+
14+
ifdef PE_ENV
15+
ifneq ($(USE_GPU),TRUE)
16+
lowercase_peenv := $(shell echo $(PE_ENV) | tr A-Z a-z)
17+
ifneq ($(lowercase_peenv),$(lowercase_comp))
18+
has_compiler_mismatch = COMP=$(COMP) does not match PrgEnv-$(lowercase_peenv)
19+
endif
20+
ifeq ($(MAKECMDGOALS),)
21+
ifeq ($(lowercase_peenv),nvidia)
22+
$(error PrgEnv-nvidia cannot be used with CPU-only builds. Try PrgEnv-gnu instead.)
23+
endif
24+
endif
25+
endif
26+
endif
27+
28+
ifeq ($(USE_CUDA),TRUE)
29+
CFLAGS += -Xcompiler='$(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null))'
30+
CXXFLAGS += -Xcompiler='$(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null))'
31+
else ifeq ($(USE_MPI),FALSE)
32+
CFLAGS += $(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null))
33+
CXXFLAGS += $(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null))
34+
endif
35+
36+
ifeq ($(USE_MPI),TRUE)
37+
ifneq ($(USE_CUDA),TRUE)
38+
CC = cc
39+
CXX = CC
40+
FC = ftn
41+
F90 = ftn
42+
LIBRARIES += -lmpichf90
43+
endif
44+
45+
includes += $(shell CC --cray-print-opts=cflags)
46+
endif
47+
48+
ifeq ($(USE_CUDA),TRUE)
49+
CUDA_ARCH = 80
50+
51+
ifeq ($(USE_MPI), FALSE)
52+
includes += $(CRAY_CUDATOOLKIT_INCLUDE_OPTS)
53+
endif
54+
55+
comm := ,
56+
ifneq ($(BL_NO_FORT),TRUE)
57+
LIBRARIES += $(subst -Wl$(comm),-Xlinker=,$(shell ftn --cray-print-opts=libs))
58+
else
59+
LIBRARIES += $(subst -Wl$(comm),-Xlinker=,$(shell CC --cray-print-opts=libs))
60+
endif
61+
62+
ifneq ($(CUDA_ROOT),)
63+
SYSTEM_CUDA_PATH := $(CUDA_ROOT)
64+
COMPILE_CUDA_PATH := $(CUDA_ROOT)
65+
else ifneq ($(CUDA_HOME),)
66+
SYSTEM_CUDA_PATH := $(CUDA_HOME)
67+
COMPILE_CUDA_PATH := $(CUDA_HOME)
68+
else ifneq ($(CUDA_PATH),)
69+
SYSTEM_CUDA_PATH := $(CUDA_PATH)
70+
COMPILE_CUDA_PATH := $(CUDA_PATH)
71+
else ifneq ($(NVIDIA_PATH),)
72+
SYSTEM_CUDA_PATH := $(NVIDIA_PATH)/cuda
73+
COMPILE_CUDA_PATH := $(NVIDIA_PATH)/cuda
74+
else
75+
$(error No CUDA_ROOT nor CUDA_HOME nor CUDA_PATH found. Please load a cuda module.)
76+
endif
77+
78+
# Provide system configuration information.
79+
80+
GPUS_PER_NODE=4
81+
GPUS_PER_SOCKET=4
82+
83+
endif
84+
85+
endif

0 commit comments

Comments
 (0)