Skip to content

Commit

Permalink
Realised that -r8 option needs to be in mkmf template file for double…
Browse files Browse the repository at this point in the history
… precision, but should not be there for single precision. Do not currently have a dynamic way of editing that mkmf template file, so added feature to choose different mkmf template file for single precision. Format is just same name as current mkmf template file with _simple added at the end.
  • Loading branch information
sit23 committed Apr 30, 2024
1 parent ec5992a commit 8fa14bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/extra/python/isca/codebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __init__(self, repo=None, commit=None, directory=None, storedir=P(GFDL_WORK,
self.path_names = []
self.compile_flags = [] # users can append to this to add additional compiler options
self.precision_compile_flags = ['-DOVERLOAD_C8'] #Default is to use double precision. User can change to single precision using cb.use_single_precision() before compile step
self.env_suffix = ''

@property
def code_is_available(self):
Expand Down Expand Up @@ -271,7 +272,7 @@ def compile(self, debug=False, optimisation=None):
'srcdir': self.srcdir,
'workdir': self.workdir,
'compile_flags': compile_flags_str,
'env_source': env,
'env_source': env+self.env_suffix,
'path_names': path_names_str,
'executable_name': self.executable_name,
'run_idb': debug,
Expand All @@ -289,6 +290,7 @@ def use_single_precision(self):
self.precision_compile_flags = ['-DOVERLOAD_C4', '-DOVERLOAD_R4']
self.executable_name = self.executable_name.strip('.x')+'_single.x'
self.builddir = P(self.workdir, 'build', self.executable_name.split('.')[0])
self.env_suffix = '_single' #needs a seperate env file as flags are different



Expand Down

0 comments on commit 8fa14bb

Please sign in to comment.