Skip to content

Commit

Permalink
🔖 v2_6
Browse files Browse the repository at this point in the history
  • Loading branch information
haykh committed Jan 24, 2023
1 parent 6fadc2d commit 88291ed
Show file tree
Hide file tree
Showing 102 changed files with 5,563 additions and 1,920 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
!LICENSE
.vscode/*.log
__pycache__

*.pyc
.DS_Store
.venv
37 changes: 23 additions & 14 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FFLAGS := @COMPILER_FLAGS@
PFLAGS := @PREPROCESSOR_FLAGS@
WARNFLAGS := @WARNING_FLAGS@

#H5OBJ := $(HDF5_INCDIR)

PFLAGS += @DEFS@
# FFLAGS += $(WARNFLAGS)

Expand All @@ -23,33 +25,40 @@ BUILD_DIR := build/
EXECUTABLE := $(BIN_DIR)$(EXE_FILE)

SRC_FILES := $(shell find $(SRC_DIR) -name '*.F90') $(addprefix $(USR_DIR), $(USER_FILE).F90)
INC_FILES := $(shell find $(SRC_DIR) -name '*.F08')
INC_FILES := $(shell find $(SRC_DIR) -name '*.F08') @ADD_INCLUDES@
OBJ_FILES := $(patsubst %.F90,%.o,$(SRC_FILES))
OBJ_FILES := $(addprefix $(BUILD_DIR),$(OBJ_FILES))

ifeq (${VERBOSE}, y)
HIDE :=
else
HIDE := @
endif

.PHONY: all depend clean

all : depend $(EXECUTABLE)

-include Makefile.depend

depend Makefile.depend:
@-./extern/makedepf90 $(SRC_FILES) -DUSROUTPUT -B $(BUILD_DIR) > Makefile.depend
${HIDE}-./extern/makedepf90 $(SRC_FILES) $(PFLAGS) -B $(BUILD_DIR) > Makefile.depend

$(EXECUTABLE): $(OBJ_FILES)
@echo Linking $(EXECUTABLE)
@mkdir -p $(@D)
@$(FC) $(FFLAGS) $(PFLAGS) $(OBJ_FILES) -o $(EXECUTABLE)
@echo [OK]: executable created at $(EXECUTABLE)
${HIDE}echo Linking $(EXECUTABLE)
${HIDE}mkdir -p $(@D)
${HIDE}$(FC) $(FFLAGS) $(PFLAGS) $(OBJ_FILES) -o $(EXECUTABLE)
${HIDE}echo [OK]: executable created at $(EXECUTABLE)


$(BUILD_DIR)%.o: %.F90
@mkdir -p $(@D)
@$(FC) $(FFLAGS) $(PFLAGS) -cpp $(addprefix -I, $(dir $(INC_FILES))) @MODULE@ $(BUILD_DIR) -c $< -o $@
@echo [OK]: compiled $<
${HIDE}mkdir -p $(@D)
${HIDE}$(FC) $(FFLAGS) $(PFLAGS) -cpp $(addprefix -I, $(dir $(INC_FILES))) @MODULE@ $(BUILD_DIR) -c $< -o $@
${HIDE}echo [OK]: compiled $<

clean :
@echo "Cleaning ..."
@rm -f $(EXECUTABLE) $(OBJ_FILES)
@rm -rf $(BIN_DIR) $(BUILD_DIR)
@rm -f Makefile.depend
${HIDE}echo "Cleaning ..."
${HIDE}rm -f $(EXECUTABLE) $(OBJ_FILES)
${HIDE}rm -rf $(BIN_DIR) $(BUILD_DIR)
${HIDE}rm -f Makefile.depend

15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tristan v2.5
# Tristan v2.6

For detailed tutorials and code description please visit our [wiki](https://princetonuniversity.github.io/tristan-v2/). If you are a new user testing the code on a new computer cluster, please consider contributing to [this chapter](https://princetonuniversity.github.io/tristan-v2/tristanv2-configure.html#cluster-specific-customization) about cluster-specific configuration to make the life easier for future generations.

Expand Down Expand Up @@ -118,6 +118,16 @@ or in the VSCode environment (see the extension list in the `.vscode/settings.js
__@TODO__

## Latest Releases
* `v2.6` __Jan 2023__
* Minor cleanup + bugfixes
* `v2.6r1` __Nov 2022__
* New absorption treatment with target B-field specified in the userfile
* Fieldsolvers separated into different files
* `v2.5.2` __Nov 2022__
* Compton module now has `nph_over_ne` to mimic high photon-to-lepton ratio
* `absorb_x` now takes care of absorbing boundary conditions, while `boundary_x` is for MPI
* New userfiles for compton-mediated turbulence and reconnection
* Minor non-critical bugs
* `v2.5.1` __Aug 2022__
* Minor configure bug when working with non-intel compilers
* Minor bug with `usroutput` flag
Expand Down Expand Up @@ -180,7 +190,8 @@ __@TODO__

---

We employ [semantic versioning](https://semver.org/) for this code. Given a version number `v<MAJOR>.<MINOR>.<PATCH>`, increment the:
We employ [semantic versioning](https://semver.org/) for this code. Given a version number `v<MAJOR>.<MINOR>.<PATCH>r<CANDIDATE>`, increment the:
- `MAJOR` version when you make incompatible changes,
- `MINOR` version when you add functionality in a backwards compatible manner, and
- `PATCH` version when you make backwards compatible bug fixes.
- `CANDIDATE`: release candidate for "nightly" builds
92 changes: 51 additions & 41 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@
unit_directory = 'unit/'
unit_choices = glob.glob(unit_directory + '*.F90')
unit_choices = [choice[len(unit_directory):-4] for choice in unit_choices]
compiler_choices = ['intel', 'aocc', 'gcc']

rad_choices = ['no', 'sync', 'ic', 'sync+ic']
clusters = ['perseus', 'frontera', 'stellar']
clusters = ['frontera', 'zaratan', 'stellar', 'ginsburg']

# system
parser.add_argument('--cluster',
default=None,
choices=clusters,
help='choose cluster-specific configurations.')

cpu_group = parser.add_mutually_exclusive_group(required=False)
cpu_group.add_argument('-intel',
action='store_true',
default=False,
help='enable Intel cpu optimizations')
cpu_group.add_argument('-amd',
action='store_true',
default=False,
help='enable AMD cpu optimizations')
parser.add_argument('--compiler',
default='gcc',
choices=compiler_choices,
help='choose the compiler.')

parser.add_argument('--vector',
default=None,
required=False,
choices=['intel-avx2', 'intel-avx512', 'amd-avx2'],
help='choose the vectorization option.')

parser.add_argument('-hdf5',
action='store_true',
Expand Down Expand Up @@ -137,6 +139,11 @@
default=False,
help='enable Vay pusher')

parser.add_argument('-blinne',
action='store_true',
default=False,
help='enable Blinne field solver')

parser.add_argument('-payload',
action='store_true',
default=False,
Expand Down Expand Up @@ -224,32 +231,34 @@
makefile_options['COMPILER_FLAGS'] = ''
makefile_options['PREPROCESSOR_FLAGS'] = ''
makefile_options['WARNING_FLAGS'] = ''
makefile_options['DEFS'] = '-DSTR_MAX=280 -DTINYXYZ=1e-6 -DTINYREAL=1e-3 -DTINYFLD=1e-8 -DTINYWEI=1e-6 -DM_PI=3.141592653589793 '
makefile_options['DEFS'] = '-DSTR_MAX=280 -DTINYXYZ=1e-6 -DTINYREAL=1e-3 -DTINYFLD=1e-8 -DTINYWEI=1e-6 -DM_PI=3.141592653589793 -DVEC_LEN=16 '
makefile_options['ADD_INCLUDES'] = ''

# specific cluster:
specific_cluster = False
if (args['cluster'] is not None):
specific_cluster = True
clustername = args['cluster'].capitalize()
args['intel'] = True
args['compiler'] = 'intel'
args['ifport'] = True
if args['cluster'] == 'perseus':
args['mpi'] = True
args['avx2'] = True
elif args['cluster'] == 'frontera':
args['mpi08'] = True
args['avx512'] = True
if args['cluster'] == 'frontera':
args['vector'] = 'intel-avx512'
args['lowmem'] = True
elif args['cluster'] == 'stellar':
args['mpi08'] = True
args['avx512'] = True
args['vector'] = 'intel-avx512'
elif args['cluster'] == 'zaratan':
args['vector'] = 'amd-avx2'
makefile_options['ADD_INCLUDES'] = '$(HDF5_INCDIR)'
elif args['cluster'] == 'ginsburg':
args['mpi'] = True
args['avx2'] = True

# compilation command
if args['hdf5']:
makefile_options['COMPILER_COMMAND'] += 'h5pfc '
makefile_options['PREPROCESSOR_FLAGS'] += '-DHDF5 '
else:
makefile_options['COMPILER_COMMAND'] += 'mpif90 ' if not args['intel'] else 'mpiifort '
makefile_options['COMPILER_COMMAND'] += 'mpif90 ' if not args['compiler'] == 'intel' else 'mpiifort '
if args['ifport']:
makefile_options['PREPROCESSOR_FLAGS'] += '-DIFPORT '
if args['lowmem']:
Expand All @@ -271,17 +280,18 @@
if int(args['debug']) >= 0:
makefile_options['PREPROCESSOR_FLAGS'] += '-DDEBUG '
if int(args['debug']) >= 1:
if args['intel'] or args['amd']:
if args['compiler'] == 'intel':
makefile_options['COMPILER_FLAGS'] += '-traceback -fpe0 '
else:
makefile_options['COMPILER_FLAGS'] += '-fbacktrace -ffpe-trap=invalid,zero,overflow,underflow,denormal '
if int(args['debug']) >= 2 and (args['intel'] or args['amd']):
# @TODO: add aocc
if int(args['debug']) >= 2 and (args['compiler'] == 'intel'):
makefile_options['COMPILER_FLAGS'] += '-check all -check noarg_temp_created '
else:
makefile_options['COMPILER_FLAGS'] += '-Ofast '

if args['double']:
if args['intel'] or args['amd']:
if args['compiler'] == 'intel':
makefile_options['COMPILER_FLAGS'] += '-r8 '
else:
makefile_options['COMPILER_FLAGS'] += '-fdefault-real-8 '
Expand All @@ -294,21 +304,23 @@
makefile_options['PREPROCESSOR_FLAGS'] += '-DTESTMODE '

# compiler (+ optimization, vectorization etc)
if args['intel']:
if args['compiler'] == 'intel':
makefile_options['MODULE'] = '-module '
makefile_options['COMPILER_FLAGS'] += '-O3 -DSoA -ipo -qopenmp-simd -qopt-report=5 -qopt-streaming-stores auto '
makefile_options['COMPILER_FLAGS'] += '-diag-disable 10397 -diag-disable 10346 '
if args['avx2']:
makefile_options['COMPILER_FLAGS'] += '-xCORE-AVX2 '
elif args['avx512']:
makefile_options['COMPILER_FLAGS'] += '-xCORE-AVX512 -qopt-zmm-usage:high '
elif args['amd']:
makefile_options['MODULE'] = '-J '
makefile_options['COMPILER_FLAGS'] += '-O3 -DSoA -fwhole-program -mavx2 -fopt-info-vec -fopt-info-vec-missed -ftree-vectorizer-verbose=5 '
makefile_options['COMPILER_FLAGS'] += '-diag-disable 10397 -diag-disable 10346 -diag-disable 8100 -diag-disable 6178 '
if args['vector'] is not None:
if args['vector'] == 'intel-avx2':
makefile_options['COMPILER_FLAGS'] += '-xCORE-AVX2 '
elif args['vector'] == 'intel-avx512':
makefile_options['COMPILER_FLAGS'] += '-xCORE-AVX512 -qopt-zmm-usage:high '
elif args['vector'] == 'amd-avx2':
makefile_options['COMPILER_FLAGS'] += '-mavx2 '
else:
makefile_options['MODULE'] = '-J '
makefile_options['COMPILER_FLAGS'] += '-O3 -DSoA -ffree-line-length-512 '

if args['vector'] is not None:
makefile_options['COMPILER_FLAGS'] += '-mavx '

if args['1d']:
makefile_options['EXE_NAME'] = 'tristan-mp1d'
makefile_options['PREPROCESSOR_FLAGS'] += '-DoneD '
Expand All @@ -335,6 +347,8 @@
str(args['gca']) + ' '
if args['vay']:
makefile_options['PREPROCESSOR_FLAGS'] += '-DVAY '
if args['blinne']:
makefile_options['PREPROCESSOR_FLAGS'] += '-DBLINNE '
if args['payload']:
makefile_options['PREPROCESSOR_FLAGS'] += '-DPRTLPAYLOADS '
if args['usroutput']:
Expand Down Expand Up @@ -367,8 +381,7 @@
if args['annihilation']:
makefile_options['PREPROCESSOR_FLAGS'] += '-DPAIRANNIHILATION '

makefile_options['PREPROCESSOR_FLAGS'] += '-DNGHOST=' + \
str(args['nghosts']) + '_2 '
makefile_options['PREPROCESSOR_FLAGS'] += '-DNGHOST=' + str(args['nghosts']) + ' '

# Step 3. Create new files, finish up
with open(makefile_input, 'r') as current_file:
Expand Down Expand Up @@ -410,10 +423,7 @@

print('TECHNICAL ....................................................................')

print(' Compiler: ' + ('intel' if args['intel'] else 'gcc') +
(' [avx2]' if args['avx2'] else
(' [avx512]' if args['avx512'] else '')
))
print(' Compiler [vec.]: ' + f'{args["compiler"]} [{args["vector"]}]')
print(' Precision: ' + ('double' if args['double'] else 'single'))
print(' Debug mode: ' +
('level ' if args['debug'] != 'OFF' else '') + args['debug'])
Expand All @@ -422,7 +432,7 @@
(' (serial)' if args['serial'] else ' (parallel)')) if args['hdf5'] else 'N/A'))
print(' User output: ' + ('ON' if args['usroutput'] else 'OFF'))
print(' MPI version: ' +
('old' if not args['mpi08'] else 'MPI_08'))
('old' if args['mpi'] else 'MPI_08'))
print(' `IFPORT` mkdir: ' + ('ON' if args['ifport'] else 'OFF'))

print('==============================================================================')
Expand Down
Loading

0 comments on commit 88291ed

Please sign in to comment.