Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink Elmer mpirun to orterun #101

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Conversation

luzpaz
Copy link
Collaborator

@luzpaz luzpaz commented Aug 15, 2023

Fixes #100

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 15, 2023

According to https://snapcraft.io/docs/snap-layouts

Some applications, however, might treat symlinks differently than regular files or directories so you may need to use a bind mount in those cases.

Elmer might not like a symlink and if that's the case we'd need to change symlink: to bind: or bind-file: even though:

Layouts using bind* and tmpfs significantly increase the startup time of your snap. We recommend using symlink instead, because it has the least amount of overhead.

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 15, 2023

CC @tecodrive

@tecodrive
Copy link

tecodrive commented Aug 15, 2023

in snap package mpirun.openmpi is a symlink to orterun*
lrwxrwxrwx 1 root root 7 Apr 15 2020 mpirun.openmpi -> orterun*

no need to use bind

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 15, 2023

hmm.. then we should link directly to orterun* or else we have a double symlink? (btw, why is there a * at the end of orterun) ?

@tecodrive
Copy link

tecodrive commented Aug 15, 2023

marked "*" as executable under Linux (ext4) orterun*

additional symlink from mpirun to orterun should be ok

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 15, 2023

Per snap documentation:

Incompatible existing file, directory or symbolic link

Layouts cannot replace an existing but incompatible filesystem object. This means, for example, that files cannot replace directories or symbolic links, files cannot replace a directory, and existing symbolic links cannot be redirected to a new target. You can, however, replace a directory with another directory.

@luzpaz luzpaz changed the title Symlink Elmer mpirun to mpirun.openmpi Symlink Elmer mpirun to orterun Aug 15, 2023
@luzpaz luzpaz merged commit d783438 into master Aug 15, 2023
@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 15, 2023

@tecodrive please test on Snap edge when build completes (https://github.com/FreeCAD/FreeCAD-snap/actions/runs/5872799602/job/15924976406) ? TIA

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 16, 2023

@tecodrive please run snap edge to test and report back. TIA!

@tecodrive
Copy link

Problem with Multi-CPU core support in FreeCAD snap package solved!
@luzpaz Many thanks, for your quick help!

Installation:

sudo snap info freecad
latest/edge: 0.22-ga49e1049 2023-08-16
sudo snap install freecad --edge

Instructions to run Multi-CPU core support in FreeCAD:

First open FEM Workbench (Mod) to get access to FEM settings in preferences
Open: Edit -> Preferences -> FEM -> Elmer
Uncheck: Search in known binary directories
Set: Elmer Solver binary path: /snap/freecad/current/usr/bin/ElmerSolver_mpi

grafik

@tecodrive
Copy link

tecodrive commented Aug 16, 2023

problem is solved, but it's crazy, there are no file mpirun in snap/freecad/current/usr/bin/

i see only

/snap/freecad/current/usr/bin/mpirun.mpich
/snap/freecad/current/usr/bin/mpirun.openmpi

how can /snap/freecad/current/usr/Mod/Fem/femsolver/elmer/task.py find mpirun?

                if system() != "Windows":
                    args.extend(["mpirun"])
                else:
                    args.extend(["mpiexec"])

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 16, 2023

@chennes sorry, tried to solve this without you but no joy. Can you weigh-in ?

@chennes
Copy link
Member

chennes commented Aug 16, 2023

I'm having a hard time following the above discussion: what is the problem we are trying to solve?

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 16, 2023

@chennes see #100

Essentially the snap is looking for a missing Elmer file (which is actually a symlink which adds to further confusion). I edited the snapcraft.yml in d783438 but the issue isn't solved.

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 16, 2023

I'm going to change the symlink to see what happens

usr/bin/mpirun.openmpi: # ElmerSolver_mpi
     symlink: $SNAP/usr/bin/mpirun

Edit: Done in 6eb4d24

Triggered a new Snap edge build https://github.com/FreeCAD/FreeCAD-snap/actions/runs/5879743555/job/15944502206
Should be ready in 1.5hrs

luzpaz added a commit that referenced this pull request Aug 16, 2023
@tecodrive
Copy link

sorry, but this was a step backwards. The bug is back, too bad.

luzpaz added a commit that referenced this pull request Aug 16, 2023
@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 16, 2023

Reverted in 18bb662

@luzpaz
Copy link
Collaborator Author

luzpaz commented Aug 16, 2023

problem is solved, but it's crazy, there are no file mpirun in snap/freecad/current/usr/bin/

i see only

/snap/freecad/current/usr/bin/mpirun.mpich
/snap/freecad/current/usr/bin/mpirun.openmpi

how can /snap/freecad/current/usr/Mod/Fem/femsolver/elmer/task.py find mpirun?

                if system() != "Windows":
                    args.extend(["mpirun"])
                else:
                    args.extend(["mpiexec"])

@berndhahnebach any idea ?

See #100 (comment)

Why doesn't the FEM code reference the file extension?

@tecodrive
Copy link

tecodrive commented Aug 16, 2023

@berndhahnebach.

There are two MPI variants from different developers. Both are included in the SNAP package.

/snap/freecad/current/usr/bin$
lrwxrwxrwx 1 root root     13 Feb 22  2022 mpirun.mpich -> mpiexec.hydra*
lrwxrwxrwx 1 root root      7 Mär  4  2022 mpirun.openmpi -> orterun*

MPICH is developed and maintained by a consortium of researchers from several universities and research centers around the world. It is considered to be one of the most widely used MPI implementations, and is known for its robustness and portability.

OpenMPI, on the other hand, is developed and maintained by a group of researchers from several organizations, including the Argonne National Laboratory, the University of Tennessee, and the Indiana University. It is considered to be one of the most flexible and configurable MPI implementations available, and is known for its support for a wide variety of interconnects and architectures.

Users who use other packages like apt, appimage etc., calling 'mpirun' in task.py is correct because these packages do not include gmesh and elmer and must be installed separately.

@tecodrive
Copy link

@luzpaz Reverted thanks, now problem is solved again.

@luzpaz luzpaz deleted the Elmer-mpirun-fix-issue-100 branch August 16, 2023 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snap Elmer dependency (mpirun.openmpi) file missing and needs symlink
3 participants