Skip to content

Commit

Permalink
Merge pull request #104 from GEOS-ESM/bugfix/mathomp4/fix-slesdetection
Browse files Browse the repository at this point in the history
Fix OS detection inside SLURM
  • Loading branch information
mathomp4 committed Oct 24, 2023
2 parents 31d366e + 43a55c2 commit 6482a34
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Added

## [4.20.3] - 2023-10-24

### Fixed

- Fixed issue with OS versioning when inside SLURM (has to be detected differently)

## [4.20.2] - 2023-10-23

### Fixed
Expand Down
22 changes: 16 additions & 6 deletions build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,23 @@ endif
# ---------------------------------------------------------------------

if ($SITE == NCCS) then
if ($nT == mil) then
set OS_VERSION = SLES15
# We now have to handle this in two ways. One if we are on a compute node and one if we aren't.
# This is because of how this script works where it sort of submits itself to the batch system
# and many of the variables known by the script before submission are lost after submission.
# So if we are on a compute node, we detect the OS version directly, but if we are just submitting on a
# head node, we instead have to just use the processor type passed in. We'll use oncompnode to detect
# which case we are in.
if ($oncompnode) then
set OS_VERSION=`grep VERSION_ID /etc/os-release | cut -d= -f2 | cut -d. -f1 | sed 's/"//g'`
else
set OS_VERSION = SLES12
if ($nT == mil) then
set OS_VERSION = 15
else
set OS_VERSION = 12
endif
endif
if (! $?BUILDDIR) setenv Pbuild_build_directory ${Pbuild_build_directory}-${OS_VERSION}
if (! $?INSTALLDIR) setenv Pbuild_install_directory ${Pbuild_install_directory}-${OS_VERSION}
if (! $?BUILDDIR) setenv Pbuild_build_directory ${Pbuild_build_directory}-SLES${OS_VERSION}
if (! $?INSTALLDIR) setenv Pbuild_install_directory ${Pbuild_install_directory}-SLES${OS_VERSION}
endif

# developer's debug
Expand Down Expand Up @@ -717,7 +727,7 @@ else if ( $SITE == NCCS ) then
--nodes=1 \
--ntasks=${numjobs} \
--time=$walltime \
--export ESMADIR,BUILDDIR,INSTALLDIR,GMI_MECHANISM,cmake_build_type,EXTRA_CMAKE_FLAGS,FORTRAN_COMPILER,INSTALL_SOURCE_TARFILE,verbose,GMI_MECHANISM_FLAG \
--export ESMADIR,BUILDDIR,INSTALLDIR,GMI_MECHANISM,cmake_build_type,EXTRA_CMAKE_FLAGS,FORTRAN_COMPILER,INSTALL_SOURCE_TARFILE,verbose,GMI_MECHANISM_FLAG,Pbuild_build_directory,Pbuild_install_directory,usegnu,notar,GMI_MECHANISM,tmpdir,docmake \
$waitflag \
$0
unset echo
Expand Down

0 comments on commit 6482a34

Please sign in to comment.