Skip to content

Commit

Permalink
Envs: mod. env pour adastra
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Oct 25, 2024
1 parent e7236c7 commit f4746ab
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 9 deletions.
18 changes: 15 additions & 3 deletions Cassiopee/Envs/sh_Cassiopee_local
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ elif [ "$MAC" = "adastra_cpu" ]; then
export ELSAPROD=adastra_cpu
export ELSAPROD=$ELSAPROD$EXT
export OMP_NUM_THREADS=48
export OMP_PLACES=cores
export PRODMODE=1
module purge

Expand Down Expand Up @@ -793,13 +794,24 @@ elif [ "$MAC" = "adastra_gpu" ]; then
export ELSAPROD=adastra_gpu
export ELSAPROD=$ELSAPROD$EXT
export OMP_NUM_THREADS=12
export OMP_PLACES=cores
export PRODMODE=1

#module purge
#module load CCE-GPU-3.1.0
#module load rocm
#module load cray-python/3.11.5
#module load cray-hdf5-parallel/1.12.2.5

module purge
#craype-accel-amd-gfx90
module load CCE-GPU-3.1.0
module load cpe/23.12
module load craype-accel-amd-gfx90a craype-x86-trento
module load PrgEnv-cray
module load rocm
module load cray-python/3.11.5
module load cray-hdf5-parallel/1.12.2.5
export LD_LIBRARY_PATH="$CRAY_LD_LIBRARY_PATH":"$LD_LIBRARY_PATH"

#export LD_LIBRARY_PATH="$CRAY_LD_LIBRARY_PATH":"$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"/opt/cray/pe/python/3.11.5/lib"
export PYTHONEXE=python3

Expand Down
48 changes: 46 additions & 2 deletions Cassiopee/KCore/Dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,11 @@ def writeSetupCfg():
elif Cppcompiler == 'craycc' or Cppcompiler == 'craycxx':
p = open("./setup.cfg", 'w')
p.write('[build_ext]\ncompiler=unix\n')
p.close()
p.close()
elif Cppcompiler == 'cc' or Cppcompiler == 'cc':
p = open("./setup.cfg", 'w')
p.write('[build_ext]\ncompiler=unix\n')
p.close()
else:
p = open("./setup.cfg", 'w')
p.write('[build_ext]\ncompiler=%s\n'%Cppcompiler)
Expand Down Expand Up @@ -514,6 +518,9 @@ def getDistUtilsCompilers():
elif Cppcompiler == 'craycxx':
vars[0] = Cppcompiler.replace('craycxx', 'craycc'); vars[1] = Cppcompiler

elif Cppcompiler == 'cc':
vars[0] = Cppcompiler; vars[1] = Cppcompiler

elif Cppcompiler == 'nvc':
vars[0] = Cppcompiler; vars[1] = Cppcompiler.replace('nvc', 'nvc++')
elif Cppcompiler == 'nvc++':
Expand Down Expand Up @@ -957,6 +964,14 @@ def getCArgs():
else: options += ['-fPIC']
options += getSimdOptions()
return options
elif Cppcompiler == "cc":
if DEBUG: options += ['-g', '-O0', '-Wall', '-D_GLIBCXX_DEBUG_PEDANTIC']
else: options += ['-DNDEBUG', '-O3', '-Wall']
if useOMP() == 1: options += ['-fopenmp']
if useStatic() == 1: options += ['--static', '-static-libstdc++', '-static-libgcc']
else: options += ['-fPIC']
options += getSimdOptions()
return options
else: return options

# Options pour le compilateur C++
Expand Down Expand Up @@ -1075,6 +1090,15 @@ def getForArgs():
options += getSimdOptions()
if EDOUBLEINT: options += ['-i8']
return options
elif f77compiler == "ftn":
if useStatic() == 1: options += ['-static']
else: options += ['-fPIC']
if DEBUG: options += ['-g', '-O0']
else: options += ['-O3']
if useOMP() == 1: options += ['-fopenmp']
options += getSimdOptions()
if EDOUBLEINT: options += ['-i8']
return options
else: return options

#==============================================================================
Expand Down Expand Up @@ -1108,6 +1132,10 @@ def getLinkArgs():
if useStatic() == 1: out += ['-static']
else: out += ['-shared']
if useOMP() == 1: out += ['-fopenmp']
elif Cppcompiler == 'cc':
if useStatic() == 1: out += ['-static']
else: out += ['-shared']
if useOMP() == 1: out += ['-fopenmp']
mySystem = getSystem()[0]
if mySystem == 'Darwin':
if useStatic() == 0: out += ['-dynamiclib']
Expand Down Expand Up @@ -2270,7 +2298,22 @@ def checkCppLibs(additionalLibs=[], additionalLibPaths=[], Cppcompiler=None,
# if l is not None:
# libs += ['omp']; paths += [l]
# else: ret = False

# craycc

if Cppcompiler == 'cc':
os.environ['CC'] = 'cc' # forced to overide setup.cfg
os.environ['CXX'] = 'cc'
os.environ['LDSHARED'] = 'ftn'
from distutils import sysconfig
cflags = sysconfig.get_config_var('CFLAGS')
sysconfig._config_vars['CFLAGS'] = '' # kill setup flags for CC
sysconfig._config_vars['LDFLAGS'] = '' # kill setup flags for LD
l = checkLibFile__('libsci_cray.so*', additionalLibPaths)
if l is None:
l = checkLibFile__('libsci_cray.a', additionalLibPaths)
if l is not None:
libs += ['sci_cray']; paths += [l]

return (ret, libs, paths)

#==============================================================================
Expand Down Expand Up @@ -2520,6 +2563,7 @@ def createExtensions(module, srcs, includeDirs, libraryDirs, libraries,
# doit voir
#==============================================================================
def getEnvForScons():
#return dict(os.environ) # for adastra
return {'PATH': getenv('PATH'),
'LD_LIBRARY_PATH': getenv('LD_LIBRARY_PATH'),
'LM_LICENSE_FILE': getenv('LM_LICENSE_FILE'),
Expand Down
23 changes: 19 additions & 4 deletions Cassiopee/KCore/installBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,12 @@
],
###############################################################################
'adastra_cpu': [ 'Machine CINES Cray',
'crayftn', # f77compiler
'crayftn', # f90compiler
'craycc', # Cppcompiler
'gfortran', # f77compiler
'gfortran', # f90compiler
'gcc', # Cppcompiler
[], # CppAdditionalOptions
[], # f77AdditionalOptions
False, # useOMP
True, # useOMP
False, # static
[], # additionalIncludePaths
[], # additionalLibs
Expand All @@ -728,6 +728,21 @@
[] # NvccAdditionalOptions
],
###############################################################################
'adastra_gpu': [ 'Machine CINES Cray',
'ftn', # f77compiler
'ftn', # f90compiler
'cc', # Cppcompiler
[], # CppAdditionalOptions
[], # f77AdditionalOptions
True, # useOMP
False, # static
[], # additionalIncludePaths
[], # additionalLibs
[], # additionalLibPaths
False, # useCuda
[] # NvccAdditionalOptions
],
###############################################################################
'ubuntu': [ 'Linux ubuntu 24.04',
'gfortran', # f77compiler
'gfortran', # f90compiler
Expand Down

0 comments on commit f4746ab

Please sign in to comment.