From faf3f3db4f54c48c4c9233b923fa57a4e5ed851b Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Mon, 23 Mar 2026 16:10:52 +0000 Subject: [PATCH 1/9] Install parRSB and parRSB.py in venv --- scripts/ml/setup_case | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index 47a8daca3..a52d66a19 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -245,6 +245,22 @@ function load_modules() { fi } +function install_parrsb() { + src_dir=${VENV_PATH}/parRSB + + # Install parRSB + git clone https://github.com/thilinarmtb/parRSB.git -b general_graph ${src_dir} + cd parRSB + cmake -B ${src_dir}/build -S ${src_dir} -DCMAKE_INSTALL_PREFIX=${VENV_PATH} + cmake --build ${src_dir}/build --target install + + # Install parRSB.py + CMAKE_MODULE_PATH=${VENV_PATH} pip install git+https://github.com/thilinarmtb/parRSB.py.git + + # Cleanup + rm -rf ${src_dir} +} + function build_smartsim() { if [ "${SYSTEM}" == "polaris" ]; then export CC=cc @@ -312,6 +328,7 @@ function setup_venv() { if [ "${CLIENT}" == "smartredis" ]; then build_smartsim fi + install_parrsb deactivate } From 82cac5e6978acdc7bb079565a38072588bf472fd Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Mon, 23 Mar 2026 16:11:53 +0000 Subject: [PATCH 2/9] build_smartsim --> install_smartsim --- scripts/ml/setup_case | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index a52d66a19..9a8ddb2d8 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -261,7 +261,7 @@ function install_parrsb() { rm -rf ${src_dir} } -function build_smartsim() { +function install_smartsim() { if [ "${SYSTEM}" == "polaris" ]; then export CC=cc export CXX=CC @@ -326,7 +326,7 @@ function setup_venv() { pip install pymech if [ "${CLIENT}" == "smartredis" ]; then - build_smartsim + install_smartsim fi install_parrsb From 9432d938a0ce997eaf24da1f647240a31ad84436 Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Mon, 23 Mar 2026 16:13:32 +0000 Subject: [PATCH 3/9] Add a message to execute `run.sh` after setup --- scripts/ml/setup_case | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index 9a8ddb2d8..f58ea3d05 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -348,3 +348,4 @@ setup_case load_modules setup_venv generate_script +echo -e "\033[35mExecute \"run.sh\" script from a compute node to run the example.\033[m" From ebd46884562e63332976b3168094ed0974aa97c7 Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Mon, 23 Mar 2026 16:17:43 +0000 Subject: [PATCH 4/9] Get rid of unused variable --- scripts/ml/setup_case | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index f58ea3d05..87587aba3 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -288,7 +288,6 @@ function install_smartsim() { } function setup_venv() { - reuse=0 if [ -d ${VENV_PATH} ]; then echo -e "\033[35mPython venv \"${VENV_PATH}\" already exists, reusing it ... \033[m" return 0 From 1c0a8d53c8d2711b028970e5a46f5de6adbb075c Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Mon, 23 Mar 2026 18:16:36 +0000 Subject: [PATCH 5/9] Add generate_halo_info.py The goal of this file is to generate halo info by reading a NekRS .re2 file. --- 3rd_party/gnn/dist-gnn/generate_halo_info.py | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 3rd_party/gnn/dist-gnn/generate_halo_info.py diff --git a/3rd_party/gnn/dist-gnn/generate_halo_info.py b/3rd_party/gnn/dist-gnn/generate_halo_info.py new file mode 100644 index 000000000..605e6a18a --- /dev/null +++ b/3rd_party/gnn/dist-gnn/generate_halo_info.py @@ -0,0 +1,40 @@ +import argparse +import mpi4py +from mpi4py import MPI +import numpy as np + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Process command line arguments." + ) + parser.add_argument( + "-p", + "--poly", + type=int, + required=True, + help="Specify the polynomial order", + ) + parser.add_argument( + "-c", + "--case", + type=str, + required=True, + help="Specify the mesh file path (.re2 file, without the extension)", + ) + parser.add_argument( + "-l", + "--log", + type=str, + default="info", + choices=["debug", "info", "warning", "error"], + required=False, + help="Specify the log level (default: info)", + ) + args = parser.parse_args() + + p = args.poly + re2_path = args.case if args.case[-4:] != ".re2" else args.case[:-4] + log_level = args.log + + comm = MPI.COMM_WORLD From ccec2308e5fb6c3f09ebf7d87de2959f72250518 Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Tue, 31 Mar 2026 16:40:03 +0000 Subject: [PATCH 6/9] Simplify parRSB/parRSB.py install --- scripts/ml/setup_case | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index 87587aba3..8156fd650 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -246,19 +246,16 @@ function load_modules() { } function install_parrsb() { - src_dir=${VENV_PATH}/parRSB + PARRSB_DIR=$(mktemp -d) # Install parRSB - git clone https://github.com/thilinarmtb/parRSB.git -b general_graph ${src_dir} - cd parRSB - cmake -B ${src_dir}/build -S ${src_dir} -DCMAKE_INSTALL_PREFIX=${VENV_PATH} - cmake --build ${src_dir}/build --target install + git clone https://github.com/thilinarmtb/parRSB.git -b general_graph ${PARRSB_DIR} + cmake -B ${PARRSB_DIR}/build -S ${PARRSB_DIR} -DCMAKE_INSTALL_PREFIX=${VENV_PATH} + cmake --build ${PARRSB_DIR}/build --target install # Install parRSB.py - CMAKE_MODULE_PATH=${VENV_PATH} pip install git+https://github.com/thilinarmtb/parRSB.py.git - - # Cleanup - rm -rf ${src_dir} + pip install git+https://github.com/thilinarmtb/parRSB.py.git --prefix ${VENV_PATH} \ + -vv -Ccmake.define.parRSB_DIR=${VENV_PATH} } function install_smartsim() { From 2f0f785f22717c43ff880100a843b04f92fe35d4 Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Tue, 31 Mar 2026 16:47:59 +0000 Subject: [PATCH 7/9] Simplify pytorch_cluster install --- scripts/ml/setup_case | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index 8156fd650..5badcdce3 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -309,13 +309,12 @@ function setup_venv() { if [ ${MODEL} == "sr-gnn" ]; then if [ ${SYSTEM} == "aurora" ]; then - cwd=${PWD} - git clone https://github.com/rusty1s/pytorch_cluster.git ${VENV_PATH}/pytorch_cluster - cd ${VENV_PATH}/pytorch_cluster - # Need to force the install to not link with OpenMP, change lines 53-54 to if False: - sed -i 's/fopenmp/lgomp/' setup.py - CXX=$(which dpcpp) python setup.py install - cd ${cwd} + PYTCLUSTER_DIR=$(mktemp -d) + git clone https://github.com/rusty1s/pytorch_cluster.git $PYTCLUSTER_DIR + # Need to force the install to not link with OpenMP, + # change lines 53-54 to if False: + sed -i 's/fopenmp/lgomp/' ${PYTCLUSTER_DIR}/setup.py + CXX=$(which dpcpp) python ${PYTCLUSTER_DIR}/setup.py install --prefix ${VENV_PATH} fi fi From 8ab8fb5e5ffa82f840def7ed26ccdc70583fffdb Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Tue, 31 Mar 2026 17:09:14 +0000 Subject: [PATCH 8/9] Use parRSB.py to read the mesh --- 3rd_party/gnn/dist-gnn/generate_halo_info.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/3rd_party/gnn/dist-gnn/generate_halo_info.py b/3rd_party/gnn/dist-gnn/generate_halo_info.py index 605e6a18a..239a1c24e 100644 --- a/3rd_party/gnn/dist-gnn/generate_halo_info.py +++ b/3rd_party/gnn/dist-gnn/generate_halo_info.py @@ -1,6 +1,6 @@ import argparse -import mpi4py from mpi4py import MPI +from parrsb import Mesh import numpy as np @@ -33,8 +33,6 @@ ) args = parser.parse_args() - p = args.poly - re2_path = args.case if args.case[-4:] != ".re2" else args.case[:-4] - log_level = args.log - comm = MPI.COMM_WORLD + m = Mesh(args.case, comm) + partitions = m.partition() From d4a12e84a58f24e7980d5fd27fb3bc4387da5bea Mon Sep 17 00:00:00 2001 From: Thilina Ratnayaka Date: Wed, 1 Apr 2026 21:40:45 +0000 Subject: [PATCH 9/9] Use the master branch of thilinarmtb/parRSB.git --- scripts/ml/setup_case | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/ml/setup_case b/scripts/ml/setup_case index 5badcdce3..6b27fdc38 100755 --- a/scripts/ml/setup_case +++ b/scripts/ml/setup_case @@ -246,16 +246,23 @@ function load_modules() { } function install_parrsb() { + GSLIB_DIR=$(mktemp -d) PARRSB_DIR=$(mktemp -d) + # Install gslib + git clone https://github.com/thilinarmtb/gslib.git -b general_graph ${GSLIB_DIR} + cmake -B ${GSLIB_DIR}/build -S ${GSLIB_DIR} -DCMAKE_INSTALL_PREFIX=${VENV} + cmake --build ${GSLIB_DIR}/build --target install + # Install parRSB - git clone https://github.com/thilinarmtb/parRSB.git -b general_graph ${PARRSB_DIR} - cmake -B ${PARRSB_DIR}/build -S ${PARRSB_DIR} -DCMAKE_INSTALL_PREFIX=${VENV_PATH} + git clone https://github.com/thilinarmtb/parRSB.git ${PARRSB_DIR} + cmake -B ${PARRSB_DIR}/build -S ${PARRSB_DIR} -DCMAKE_INSTALL_PREFIX=${VENV} \ + -Dgs_DIR=${VENV}/lib/cmake/gs cmake --build ${PARRSB_DIR}/build --target install # Install parRSB.py - pip install git+https://github.com/thilinarmtb/parRSB.py.git --prefix ${VENV_PATH} \ - -vv -Ccmake.define.parRSB_DIR=${VENV_PATH} + pip install git+https://github.com/thilinarmtb/parRSB.py --prefix ${VENV} -vv \ + -Ccmake.define.parRSB_DIR=${VENV}/lib/cmake/parRSB } function install_smartsim() {