minimal C++ build and example

Provides a system for patient-specific cardiovascular modeling and simulation.
User avatar
Mandar Kulkarni
Posts: 16
Joined: Tue Jul 13, 2021 10:38 am

Re: minimal C++ build and example

Post by Mandar Kulkarni » Mon Jun 06, 2022 2:30 pm

davep wrote:
Fri Jun 03, 2022 11:41 am

I just tried this on MacOS Catalina and it worked fine. In a terminal do the following to check that /usr/local/bin is a directory

Code: Select all

$ file /usr/local/bin
/usr/local/bin: directory
This worked fine.

However, when I try running svsolver through a terminal, I get this error. I have been reading some earlier posts but couldnt get it working.. any suggestions?

Code: Select all

mandar@Mandars-MBP steadyMK2 % mpiexec --version
mpiexec (OpenRTE) 4.1.4

Report bugs to http://www.open-mpi.org/community/help/
mandar@Mandars-MBP steadyMK2 % mpiexec -np 4 /usr/local/sv/svsolver/2022-02-07/bin/svsolver solver.inp 
dyld[4758]: Library not loaded: /usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib
  Referenced from: /usr/local/sv/svsolver/2022-02-07/bin/svsolver
  Reason: tried: '/usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/local/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/lib/libmpi_usempif08.40.dylib' (no such file)
dyld[4759]: Library not loaded: /usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib
  Referenced from: /usr/local/sv/svsolver/2022-02-07/bin/svsolver
  Reason: tried: '/usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/local/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/lib/libmpi_usempif08.40.dylib' (no such file)
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
dyld[4760]: Library not loaded: /usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib
  Referenced from: /usr/local/sv/svsolver/2022-02-07/bin/svsolver
  Reason: tried: '/usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/local/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/lib/libmpi_usempif08.40.dylib' (no such file)
dyld[4761]: Library not loaded: /usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib
  Referenced from: /usr/local/sv/svsolver/2022-02-07/bin/svsolver
  Reason: tried: '/usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/local/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/lib/libmpi_usempif08.40.dylib' (no such file)
--------------------------------------------------------------------------
mpiexec noticed that process rank 1 with PID 0 on node Mandars-MBP exited on signal 6 (Abort trap: 6).
--------------------------------------------------------------------------

Thanks,
Mandar

User avatar
Mandar Kulkarni
Posts: 16
Joined: Tue Jul 13, 2021 10:38 am

Re: minimal C++ build and example

Post by Mandar Kulkarni » Tue Jun 07, 2022 11:02 am

More tries:

(a) Trying to run directly through SV gui but no MPI, that is single processor (this is doe by leaving the "Use MPI" box unchecked)
This is a success and I get all the output files and I can open them in Paraview etc.

(b) Trying to run through command line with single processor.
Here is the error I get:

Code: Select all

mandar@Mandars-MBP steadyMK3 % /usr/local/sv/svsolver/2022-02-07/bin/svsolver solver.inp 
dyld[5437]: Library not loaded: /usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib
  Referenced from: /usr/local/sv/svsolver/2022-02-07/bin/svsolver
  Reason: tried: '/usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/local/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/lib/libmpi_usempif08.40.dylib' (no such file)
zsh: abort      /usr/local/sv/svsolver/2022-02-07/bin/svsolver solver.inp
(c) Trying to use MPI through SV gui
I selected Use MPI and Number of processes = 4, however get this error message:
"svSolver requires OpenMPI but an OpenMPI MPI implementation was not found.
Please install OpenMPI MPI or set the location of an OpenMPI mpiexec in the Preferences->SimVascular Simulation page."
I have also attached a screenshot of how this looks like.

On searching the forum for this error, I saw this post
viewtopicPhpbb.php?f=188&t=13637&p=0&st ... c8e4bccdac
which required to change the executable file to be within the /bin folder and that is what I have (see attached pic).

Any suggestions?

Thanks much,
Mandar
Attachments
SV_preferences.png
SV_preferences.png (250.47 KiB) Viewed 320 times
SV_MPI_error.png
SV_MPI_error.png (684.31 KiB) Viewed 320 times

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

Re: minimal C++ build and example

Post by David Parker » Tue Jun 07, 2022 11:43 am

Hi Mandar,

The svSolver was built on MacOS Catalina using OpenMPI 4.1.2. It seems that MPI library versions have changed for MacOS Monterey 12.0.1 OpenMPI 4.1.4. There area a couple of things you can try

1) Install OpenMPI 4.1.2.

2) Build svSolver from source

Option #2 might be tricky if you are using the M1 chip because svSolver needs VTK to build. See https://github.com/SimVascular/svSolver for instructions for building with a local version of VTK.

Cheers,
Dave

User avatar
Mandar Kulkarni
Posts: 16
Joined: Tue Jul 13, 2021 10:38 am

Re: minimal C++ build and example

Post by Mandar Kulkarni » Tue Jun 07, 2022 8:13 pm

Hi Dave,

Here's my update:

I installed OpenMPI 4.1.2 as per your suggestion but am still getting this error:

Code: Select all

mandar@Mandars-MBP steadyMK2 % mpiexec -np 4 /usr/local/sv/svsolver/2022-02-07/svsolver solver.inp
--------------------------------------------------------------------------
Sorry!  You were supposed to get help about:
    opal_init:startup:internal-failure
But I couldn't open the help file:
    /usr/local/Cellar/open-mpi/4.1.2/share/openmpi/help-opal-runtime.txt: No such file or directory.  Sorry!
--------------------------------------------------------------------------
...
... above error repeated several times...
..
The only good thing was that svsolver-nompi was working well. However this may not be enough for larger cases.

For now, I am reverting to my linux machine where I can run the svsolver with MPI. So the process that seems to work for me is (a) export the solver input files through the "Export Data Files" feature, (b) transfer files to the linux machine and run svsolver with mpi, (c) transfer files back to the local machine and convert results.

I will probably build svSolver from source, but with M1 not VTK compatible (yet?) it seems only an uphill slope for now, so will postpone that until later.

Thanks so much for your help and all the posts on the forum.

Mandar

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

Re: minimal C++ build and example

Post by David Parker » Mon Jun 13, 2022 7:01 pm

Hi Mandar,

I borrowed a friend's Mac Monterey / M1 and did some tests. Installing OpenMPI 4.1.2 does not work because that is compiled for the M1 chip and the svSolver was compiled with the Intel libraries. I should have thought of that, sorry to mislead you!

I was able to compile svSolver from source after installing VTK and Qt5 and hacking a CMake file. The solver runs fine using a single processor but seg faults when using two or more. I'm not sure what's going on, perhaps a memory problem (see https://github.com/SimVascular/svSolver/issues/105). I did get a simulation to run after commenting out some code. I will investigate further when I have more time.

Cheers,
Dave

User avatar
Mandar Kulkarni
Posts: 16
Joined: Tue Jul 13, 2021 10:38 am

Re: minimal C++ build and example

Post by Mandar Kulkarni » Tue Jun 14, 2022 9:46 am

Hi Dave,

No worries, I learned some things about OpenMPI that way :)

Thanks for going all the way to test this out on the M1 chip.

For now, I am set with Ubuntu 18 machine doing the jobs for me.

Mandar

POST REPLY