Keywords for svpost in .slurm files

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Alessandro Ruggeri
Posts: 10
Joined: Sun Jul 02, 2023 2:47 am

Keywords for svpost in .slurm files

Post by Alessandro Ruggeri » Mon Apr 29, 2024 7:02 am

Dear all,

I've some trouble in generating .txt velocity, flow and pressure average files after converting results.
Actually, i'm working without a GUI in a server that is Linux-based. I run simulations after uploading all simulation files in a directory and by running a .slurm file.
Simulation run fine, and i can reduce results and obtain .vtu and .vtp files, but i can take .txt average files.

The general structure of .slurm file that i use is the following:

Code: Select all

#!/bin/bash -l

#SBATCH --nodes=1
#SBATCH --ntasks=16
#SBATCH --partition=debug
#SBATCH --job-name=test

WORK_DIR=/home/
EXE_DIR=/opt/svSolver-build/svSolver-build/bin

module purge
module load mpi/openmpi3-x86_64
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

cd ${WORK_DIR}/$SLURM_JOB_NAME

#launch simulation
mpirun ${EXE_DIR}/svsolver > ./log

#reduce results
${EXE_DIR}/svpost -all -indir ./$SLURM_NTASKS-procs_case -outdir ./ -start 4546 -stop 5054 -incr 2 -vtkcombo -vtp $SLURM_JOB_NAME.vtp -vtu $SLURM_JOB_NAME.vtu

I've found this instruction for svpost, but I don't know how to make those work in .slurm file

Code: Select all

create-flow-files --mesh-directory /home/test/mesh-complete/mesh-surfaces/    --output-directory /home/test/  --results-directory /home/test/  --single-file no --skip-walls yes  --units cm
Can you help me?

Best regards,
Alessandro

User avatar
David Parker
Posts: 1771
Joined: Tue Aug 23, 2005 2:43 pm

Re: Keywords for svpost in .slurm files

Post by David Parker » Mon Apr 29, 2024 5:09 pm

Hi Alessandro,

There is no functionality in svpost to create flow files.

The create-flow-files you refer to is I think a program I wrote to create flow files (see https://github.com/ktbolt/cardiovascula ... flow-files).

I've never built this guy on an HPC cluster but you can download the C++ source and try to build it (needs CMake and VTK).

Cheers,
Dave

User avatar
Alessandro Ruggeri
Posts: 10
Joined: Sun Jul 02, 2023 2:47 am

Re: Keywords for svpost in .slurm files

Post by Alessandro Ruggeri » Fri Nov 08, 2024 3:50 am

Dear Dave,
thank you for your kindly answer.

I'll try to build the program!

User avatar
Alessandro Ruggeri
Posts: 10
Joined: Sun Jul 02, 2023 2:47 am

Re: Keywords for svpost in .slurm files

Post by Alessandro Ruggeri » Fri Nov 08, 2024 1:43 pm

Dear Dave,
I've build succesfully. However, when i try to convert the result of the cylinder example, nothing happens.

This is the code i run with slurm

Code: Select all

#!/bin/bash -l

#SBATCH --nodes=1
#SBATCH --ntasks=2
#SBATCH --partition=debug
#SBATCH --job-name=steady_rcr

WORK_DIR=/home/michelec/SimVascular/Test_resuts_cilindro
EXE_DIR=/home/michelec/SimVascular/results2flow/build

module purge
module load mpi/openmpi3-x86_64
export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH

mkdir ${WORK_DIR}/$SLURM_JOB_NAME/flow-files
#cd ${WORK_DIR}/$SLURM_JOB_NAME/

${EXE_DIR}/create-flow-files --mesh-directory ${WORK_DIR}/$SLURM_JOB_NAME/mesh-complete/mesh-surfaces   --output-directory ${WORK_DIR}/$SLURM_JOB_NAME/flow-files  --results-directory ${WORK_DIR}/$SLURM_JOB_NAME/$SLURM_NTASKS-procs_case  --single-file no --skip-walls yes  --units cm
This is the directory tree:
-steady_rcr --> main project folder
|-------------2procs-case-----------> here i have restart files, and also converted results as depicted below
|-------------converted-results-----> here i save converted results by svpost; both vtu and vtp, one for each timestep, including the "0" timestep
|-------------flow-files---------------> here i want to save the flow files generated by create-flow-files code
|-------------mesh-complete--------> here i have mesh, and subfolders, generated properly by svpre

This is the output i've receved:

Code: Select all

Output directory: /home/michelec/SimVascular/Test_resuts_cilindro/steady_rcr/flow-files
Number of converted results files: 0
Number of face files: 3
I don't understand where i have to point when declaring the "--results-directory".
I've tried pointing to the folder with the converted results, but i receive the output mentioned above.
The same happens pointing to the folder with the restart files.
And again, pointing to a folder that conotains btoh restart files and converted results.

What am i doing wrong?

Thanks for your help!

Best regards,
Alessandro

User avatar
David Parker
Posts: 1771
Joined: Tue Aug 23, 2005 2:43 pm

Re: Keywords for svpost in .slurm files

Post by David Parker » Tue Nov 12, 2024 10:38 am

Hi Alessandro,

The --results-directory argument is the directory of the simulation results converted to VTK .vtp and .vtu files typically in a <NAME>-converted-results directory (see https://github.com/ktbolt/cardiovascula ... flow-files).

Cheers,
Dave

User avatar
Alessandro Ruggeri
Posts: 10
Joined: Sun Jul 02, 2023 2:47 am

Re: Keywords for svpost in .slurm files

Post by Alessandro Ruggeri » Wed Nov 20, 2024 4:18 pm

Hi Dave,
thanks for the answer.

I've tried again and i think the folders are correctly pointed, however, no flow file where creted.
The output message always say
Number of converted results files: 0
Number of face files: 3
Am i drown in an inch of water, or may be there is a bug in the code?
I've tried also with more complex simulations, but the flow files creation wont work.

Can you help me If i upload an explicative video?

Thanks in advance.

Have a nice day,
Alessandro

User avatar
David Parker
Posts: 1771
Joined: Tue Aug 23, 2005 2:43 pm

Re: Keywords for svpost in .slurm files

Post by David Parker » Thu Nov 21, 2024 11:35 am

Hi Alessandro,

The --results-directory parameter is the directory containing the VTK files you converted from you simulation files using svpost.

The Number of converted results files: 0 message means that the program could not find any VTK files. These files should be named like

Code: Select all

all_results_00100.vtp
all_results_00200.vtu
all_results_00400.vtp	
all_results_00500.vtu	
all_results_00100.vtu
The program is expecting the files named all_results_*.

Cheers,
Dave

User avatar
Alessandro Ruggeri
Posts: 10
Joined: Sun Jul 02, 2023 2:47 am

Re: Keywords for svpost in .slurm files

Post by Alessandro Ruggeri » Mon Dec 02, 2024 8:14 am

Hi Dave,
thank you for the support.
I don't figured out earlier that the converted results' names must be exactly "all_results_*".

I changed the names and now the output is:
Output directory: /home/michelec/SimVascular/Test_resuts_cilindro/steady_rcr/flow-files
Number of converted results files: 11 --> Fine, as the number of the files i've in folder
Number of face files: 3

segmentation fault (core dumped)
I've tried the same commands in two different HPC server (UNIX), but the same error came out.

Is there a bug in the create-flow-file code? How can i found it and eventually fix it?

I know that downloading all the results (restarts + converted vtu and vtk) and running the calculate flow by GUI will we a "solution", but this process will be very time consuming for large simulations (downloading the 100 GB of restarts + results takes some days!).

I also know that i can use paraview and use some filters by GUI for integrate variables, but also this will be time consuming.

Did you know any faster solution?

Thanks in advance,
Alessandro

User avatar
David Parker
Posts: 1771
Joined: Tue Aug 23, 2005 2:43 pm

Re: Keywords for svpost in .slurm files

Post by David Parker » Tue Dec 03, 2024 12:39 pm

Hi Alessandro,

Is there a bug in the create-flow-file code? How can i found it and eventually fix it?

I wrote this program for a user to mimic what SV does so the program is expecting data in a certain location. It uses code that I extracted from SV and that code doesn't do any error checking.

You can use gdb to see where the program is crashing. You might could also try running it on workstation, maybe something going on with the HPC software or accessing the data.

Cheers,
Dave

POST REPLY