From 9c61b468507498be02dc9395f829fbdc87b1f367 Mon Sep 17 00:00:00 2001 From: Qiyu8 Date: Tue, 19 Jul 2022 10:22:00 +0800 Subject: [PATCH 1/2] add update func and update init.sh --- init.sh | 5 +- src/analysisService.py | 3 + src/installService.py | 17 +++++ src/jarvis.py | 5 ++ .../lammps.airebo.openmp.arm.cpu.config | 70 +++++++++++++++++++ 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 templates/lammps/2021.5.27/lammps.airebo.openmp.arm.cpu.config diff --git a/init.sh b/init.sh index bcc809c..0ab2613 100644 --- a/init.sh +++ b/init.sh @@ -14,4 +14,7 @@ export JARVIS_DOWNLOAD=${CUR_PATH}/downloads export JARVIS_TMP=${CUR_PATH}/tmp export DOWNLOAD_TOOL=${CUR_PATH}/package/common/download.sh #Install modules -yum install -y environment-modules +if ! type module >/dev/null 2>&1;then + echo "Install environment-modules" + yum install -y environment-modules +fi diff --git a/src/analysisService.py b/src/analysisService.py index 24c230a..1c769c5 100644 --- a/src/analysisService.py +++ b/src/analysisService.py @@ -87,5 +87,8 @@ class AnalysisService: def install_deps(self): self.jinstall.install_depend() + def update(self): + self.jinstall.update() + def gen_def(self, image): self.jcontainer.gen_def(image) diff --git a/src/installService.py b/src/installService.py index f5543d5..a2a622e 100644 --- a/src/installService.py +++ b/src/installService.py @@ -423,4 +423,21 @@ chmod +x {depend_file} print(f"FOUND: {file}") if not flag: print("NOT FOUND") + + # update path when hpcrunner is translocation + def update(self): + file1_list = [d for d in glob(self.MODULE_FILES+'/**', recursive=True)] + file2_list= [d for d in glob(self.MODULE_DEPS_PATH+'/**', recursive=True)] + file_list = file1_list+file2_list + module_list = [] + for file in file_list: + if not os.path.isdir(file): + module_list.append(file) + for file in module_list: + content = self.tool.read_file(file) + search_old_path = re.search(r'prefix +(.*hpcrunner)', content) + if search_old_path: + content = content.replace(search_old_path.group(1), self.ROOT) + self.tool.write_file(file, content) + print("update successfully.") \ No newline at end of file diff --git a/src/jarvis.py b/src/jarvis.py index 8e400a7..e95b4ab 100644 --- a/src/jarvis.py +++ b/src/jarvis.py @@ -48,6 +48,8 @@ class Jarvis: parser.add_argument("-bench","--benchmark", help="start benchmark test...", nargs=1) # start test parser.add_argument("-t","--test", help="start Jarvis test...", action="store_true") + # update modulefile path when hpcrunner is moved + parser.add_argument("-u","--update", help="start update jarvis...", action="store_true") self.args = parser.parse_args() def main(self): @@ -120,5 +122,8 @@ class Jarvis: if self.args.test: self.analysis.test() + if self.args.update: + self.analysis.update() + if __name__ == '__main__': Jarvis().main() diff --git a/templates/lammps/2021.5.27/lammps.airebo.openmp.arm.cpu.config b/templates/lammps/2021.5.27/lammps.airebo.openmp.arm.cpu.config new file mode 100644 index 0000000..8f0e593 --- /dev/null +++ b/templates/lammps/2021.5.27/lammps.airebo.openmp.arm.cpu.config @@ -0,0 +1,70 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +lammps/2021.5.27 https://download.lammps.org/tars/lammps-27May2021.tar.gz + +[DEPENDENCY] +module purge +./jarvis -install bisheng/2.1.0 com +module use ./software/modulefiles +module load bisheng2/2.1.0 +export CC=clang CXX=clang++ FC=flang +#./jarvis -install hmpi/1.1.1 clang +module use /workspace/public/software/modules/ +module load mpi/hmpi/1.1.1/bisheng2.1.0 +#module load hmpi1/1.1.1 +./jarvis -install fftw/3.3.8 clang+mpi +tar -xvf ${JARVIS_DOWNLOAD}/lammps-27May2021.tar.gz + +[ENV] +module purge +module use ./software/modulefiles +module use /workspace/public/software/modules/ +module load bisheng2/2.1.0 +module load hmpi1/1.1.1 +module load mpi/hmpi/1.1.1/bisheng2.1.0 +export CC=clang CXX=clang++ FC=flang +module load fftw/3.3.8 + +[APP] +app_name = lammps +build_dir = ./lammps-27May2021/src +binary_dir = $JARVIS_ROOT/lammps-27May2021/src +case_dir = ./workloads/lammps_graphyne_nanotube/airebo/ + +[BUILD] +sed -i '9c\export OMPI_CXX = clang++' MAKE/OPTIONS/Makefile.g++_openmpi +sed -i '11c\CCFLAGS = -g -O3 -fopenmp -I${JARVIS_ROOT}/software/compiler/bisheng/2.1.0/include/c++/v1 -L${JARVIS_ROOT}/software/compiler/bisheng/2.1.0/lib -std=c++11 -stdlib=libc++ -lc++ -lc++abi' MAKE/OPTIONS/Makefile.g++_openmpi +sed -i '16c\LINKFLAGS = -g -O -fopenmp -L${JARVIS_ROOT}/software/compiler/bisheng/2.1.0/lib -std=c++11 -stdlib=libc++ -lc++ -lc++abi' MAKE/OPTIONS/Makefile.g++_openmpi +sed -i '54c\FFT_INC = -DFFT_FFTW -I${JARVIS_ROOT}/software/libs/bisheng2/hmpi1/fftw/3.3.8/include ' MAKE/OPTIONS/Makefile.g++_openmpi +sed -i '55c\FFT_PATH = -L${JARVIS_ROOT}/software/libs/bisheng2/hmpi1/fftw/3.3.8/lib' MAKE/OPTIONS/Makefile.g++_openmpi +sed -i '56c\FFT_LIB = -lfftw3' MAKE/OPTIONS/Makefile.g++_openmpi +make yes-KSPACE +make yes-MPIIO +make yes-MISC +make yes-MOLECULE +make yes-MANYBODY +make yes-USER-REAXC +make yes-USER-OMP +make g++_openmpi -j + +[RUN] +run = dsub -n lammps_hmpi -A shenchao --job_type cosched -N 1 -R "cpu=64" -o out_%J.log -e err_%J.log mpirun -x PATH -x LD_LIBRARY_PATH -x OMP_NUM_THREADS=2 -map-by ppr:64:node:pe=2 --mca plm_rsh_agent /opt/batch/agent/tools/dstart -np 64 +#run = mpirun -np 128 +#run = cat workloads/lammps_graphyne_nanotube/airebo/out_13118.log +binary = lmp_g++_openmpi -in in.tension -v model_name data.lmp -v rate 0.005 -v T 100 +nodes = 1 + +[BATCH] +#!/bin/bash + +temperatures='100 500 900' +N=15 # +lmp_exec=lmp # +tension_rate=0.005 # + +for T in ${temperatures};do + mpirun -np ${N} ${lmp_exec} -in in.tension -v model_name data.lmp -v rate ${tension_rate} -v T ${T} +done + -- Gitee From f54e9a82a74a611e0090753c506389dff8e9f438 Mon Sep 17 00:00:00 2001 From: Qiyu8 Date: Tue, 19 Jul 2022 10:36:35 +0800 Subject: [PATCH 2/2] update README.md --- README.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d11bde8..6353c28 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # HPCRunner : 贾维斯智能助手 -## ***愿景:在任意机器的任意目录部署最优化HPC应用*** +## ***愿景:自动容器化助力极简部署,一站式调优HPC应用*** ### 项目背景 @@ -38,18 +38,6 @@ ### 已验证HPC应用 -- [x] CP2K - -- [x] Amber - -- [x] QE - -- [x] VASP - -- [x] ABINIT - -- [x] SIESTA - 气象海洋领域: - [x] WRF @@ -73,8 +61,15 @@ 计算化学领域: - [x] CP2K - - [x] nwchem +- [x] Amber +- [x] QE + +- [x] VASP + +- [x] ABINIT + +- [x] SIESTA 量子力学领域: @@ -247,6 +242,12 @@ eg: ./jarvis -container openeuler:openeuler ./jarvis -h ``` +19.更新路径(如果移动了贾维斯的路径) + +``` +./jarvis -u +``` + ### 路标 ![RoadMap](./images/roadmap.png) @@ -274,3 +275,5 @@ eg: ./jarvis -container openeuler:openeuler 揭开HPC应用的神秘面纱:https://zhuanlan.zhihu.com/p/489828346 我和容器有个约会:https://zhuanlan.zhihu.com/p/499544308 + +贾维斯:完美而凛然HPC应用管家 https://zhuanlan.zhihu.com/p/518460349 -- Gitee