Skip to content

Commit

Permalink
Add gnu make for Femto
Browse files Browse the repository at this point in the history
  • Loading branch information
josephzhang8 committed Aug 25, 2023
1 parent 179f448 commit d01a666
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 1 deletion.
95 changes: 95 additions & 0 deletions mk/Make.defs.femto
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
################################################################################
# Parallel SCHISM Makefile
#
# User makes environment settings for particular OS / PLATFORM / COMPILER / MPI
# below as well as setting flags having to do with included algorithms (e.g. sediment)
# and the compiler configuration (debug, timing).
#
# The environment settings are based on the following options.
#
# Compiler name:
# FCS: Serial compiler (for utilities)
# FCP: Parallel compiler
# FLD: Linker (in general same as parallel compiler)
#
# Compilation flags
# FCSFLAGS: Flags for serial compilation
# FCPFLAGS: Flags for parallel compilation (including all pre-processing flags)
# FLDFLAGS: Flags for linker (e.g., -O2)
#
# Preprocessor flags:
# DEBUG: Enable debugging code
# ORDERED_SUM: Enable globally ordered sums & dot-products for bit reproducibility
# of state quantities independent of number of processors (note: this can
# significantly degrade performance);
# INCLUDE_TIMING: Enable wallclock timing of code (note: this can have slight
# effect on performance);
# MPI_VERSION = 1 or 2: Version of MPI (try 2 first, if compile fails due to mpi
# related errors then switch to version 1;
#
# Libraries (needed for parallel code)
# MTSLIBS: Flags for linking ParMeTiS/MeTiS libaries
################################################################################

################################################################################
## Sciclone/Femto
################################################################################
ENV = FEMTO

################################################################################
# Alternate executable name if you do not want the default.
################################################################################
EXEC := pschism_$(ENV)_Intel

################################################################################
# Environment
################################################################################

FCP = mpif90
FCS = ifort
FLD = $(FCP)
# MPI vserion (1 or 2)
PPFLAGS := $(PPFLAGS) -DMPIVERSION=2

#-CB is much slower to compile and run
#Pure MPI
FCPFLAGS = $(PPFLAGS) -O3 -xCORE-AVX2 -mcmodel=medium -fma -align array64byte -finline-functions
FLDFLAGS = -O3 -xCORE-AVX2 -mcmodel=medium -fma -align array64byte -finline-functions

#Hybrid
#FCPFLAGS = $(PPFLAGS) -O2 -mcmodel=medium -assume byterecl -ipo -axCORE-AVX2 -xSSE4.2 -qopenmp
#FLDFLAGS = -O2 -mcmodel=medium -ipo -axCORE-AVX2 -xSSE4.2 -qopenmp
#EXEC := $(EXEC)_OMP

#####Libraries
#MTSLIBS = -L./ParMetis-3.1-Sep2010/ -lparmetis -lmetis
CDFLIBS = -L$(NETCDF_FORTRAN)/lib -L$(NETCDF)/lib -lnetcdf -lnetcdff
CDFMOD = -I$(NETCDF)/include -I$(NETCDF_FORTRAN)/include # modules for netcdf


################################################################################
# Algorithm preference flags.
# Comment out unwanted modules and flags.
################################################################################

# -DSCHISM is always on and is defined elsewhere

include ../mk/include_modules

# Don't comment out the follow ifdef
ifdef USE_GOTM
GTMMOD = -I/sciclone/home10/yinglong/SCHISM/svn/trunk/src/GOTM3.2.5/modules/IFORT/ #modules
GTMLIBS = -L/sciclone/home10/yinglong/SCHISM/svn/trunk/src/GOTM3.2.5/lib/IFORT/ -lturbulence_prod -lutil_prod
else
GTMMOD =
GTMLIBS =
endif


######### Specialty compiler flags and workarounds
# Add -DNO_TR_15581 like below for allocatable array problem in sflux_subs.F90
# PPFLAGS := $(PPFLAGS) -DNO_TR_15581

# Obsolete flags: use USE_WRAP flag to avoid problems in ParMetis lib (calling C from FORTRAN)
# PPFLAGS := $(PPFLAGS) -DUSE_WRAP

1 change: 0 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ CONFIG_OBJS := $(addprefix o/$(config)/, $(OBJS))
# Names of source files with relative path as found on $VPATH
FULLSRC := $(foreach f,$(subst .o,.F90,$(OBJS)),$(firstword $(wildcard $(VPATH:%=%$f) not-found:$f)))

#PARMETISDIR := ./ParMetis-3.1-Sep2010
PARMETISDIR := ./ParMetis-4.0.3
ifeq ($(ENV),EDISON)
PARMETISDIR := $(PARMETISDIR).cray
Expand Down

0 comments on commit d01a666

Please sign in to comment.