diff --git a/src/installService.py b/src/installService.py index e57afc416ea0dc28d16069ae8e699848d0a64997..8fb1a8b584ed5850f9b5637dcc9f96a4d5c6546f 100644 --- a/src/installService.py +++ b/src/installService.py @@ -7,6 +7,8 @@ import fnmatch from enum import Enum from glob import glob +import subprocess + from dataService import DataService from toolService import ToolService from executeService import ExecuteService @@ -37,6 +39,14 @@ class InstallService: self.UTILS_PATH = os.path.join(self.SOFTWARE_PATH, 'utils') self.json = JSONService(self.INSTALL_INFO_PATH) + def command_exists(self, command): + try: + subprocess.run([command, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + return True + except FileNotFoundError: + return False + + def get_version_info(self, info, reg = r'\d+(?:\.\d+)*'): matched_group = re.search(reg ,info) @@ -103,10 +113,13 @@ class InstallService: def get_hmpi_version(self, hmpi_v3_info): if hmpi_v3_info != "": ucg_path = self.get_cmd_output('which ucg_info')[0] + ucg_path = os.path.dirname(ucg_path) + libr_path = os.path.join(ucg_path, "../../../../../") else: ucg_path = self.get_cmd_output('which ucx_info')[0] - ucg_path = os.path.dirname(ucg_path) - libr_path = os.path.join(ucg_path, "../../../../../") + ucg_path = os.path.dirname(ucg_path) + libr_path = os.path.join(ucg_path, "../../../") + print(libr_path) version = None for version in os.listdir(libr_path): @@ -115,8 +128,9 @@ class InstallService: return self.get_version_info(version) def get_hmpi_info(self): + hmpi_v3_info = (self.get_cmd_output('ucg_info -c | grep -i PLANC')[0]).upper() hmpi_v2_info = (self.get_cmd_output('ucx_info -c | grep -i BUILT')[0]).upper() - hmpi_v3_info = (self.get_cmd_output('ucg_info -c | grep -i PLANC')[0]).upper() + if "BUILT" not in hmpi_v2_info and "PLANC" not in hmpi_v3_info: return None name = 'hmpi' diff --git a/templates/gromacs/2022.5/data.gromacs.arm.cpu.config b/templates/gromacs/2022.5/data.gromacs.arm.cpu.config index 3c8af090b4f9e5f316c4031b5533a52c1387f213..386725739b732a6084be98f41ead83d8607f52d4 100644 --- a/templates/gromacs/2022.5/data.gromacs.arm.cpu.config +++ b/templates/gromacs/2022.5/data.gromacs.arm.cpu.config @@ -13,8 +13,7 @@ export CC=clang CXX=clang++ FC=flang ./jarvis -install openblas/0.3.18 bisheng module use software/moduledeps/bisheng2.1.0 module load openblas/0.3.18 -./jarvis -install cmake/3.23.1 bisheng -module load cmake/3.23.1 + ./jarvis -install hmpi/1.1.1 bisheng module use software/moduledeps/bisheng2.1.0 module load hmpi/1.1.1 @@ -34,13 +33,14 @@ module load bisheng/2.1.0 module use software/moduledeps/bisheng2.1.0 module load hmpi/1.1.1 module load openblas/0.3.18 -module load cmake/3.23.1 + module use software/moduledeps/bisheng2.1.0-hmpi1.1.1 module load fftw/3.3.8 + export CC=mpicc CXX=mpicxx FC=mpifort export PATH=${JARVIS_ROOT}/gromacs-2022.5-kml/bin:$PATH openblas_path=$JARVIS_LIBS/bisheng2.1.0/openblas/0.3.18 -fftw_path=$JARVIS_LIBS/bisheng2.1.0/hmpi1.1.1/fftw/3.3.8 +fftw_path=$JARVIS_LIBS/bisheng2.1.0/fftw/3.3.8/ [APP] app_name = gromacs @@ -55,7 +55,7 @@ mkdir -p build cd build openblas_path=$JARVIS_LIBS/bisheng2.1.0/openblas/0.3.18 -fftw_path=$JARVIS_LIBS/bisheng2.1.0/hmpi1.1.1/fftw/3.3.8 +fftw_path=$JARVIS_LIBS/bisheng2.1.0/fftw/3.3.8/ FLAGS="-mcpu=tsv110"; CFLAGS=$FLAGS CXXFLAGS=$FLAGS LDFLAGS="-lflang -fuse-ld=lld" CC=mpicc CXX=mpicxx \ cmake \