CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   New OpenFOAM solver in Singularity container (https://www.cfd-online.com/Forums/openfoam-programming-development/227173-new-openfoam-solver-singularity-container.html)

mostanad May 20, 2020 02:01

New OpenFOAM solver in Singularity container
 
Hi everybody,
I am working on a cluster in which OpenFOAM has been installed. This installation hass been done via singularity container. As you know, singularity container is created by a recipe, and the final result(.sif file) has just a read mode. So now I want to compile my modified solver on this container. The problem is that I have not the related recipe so I should generate my sandbox directory by:
singularity build --sandbox my_sbox cfdem.sif
so after adding the solver, and unfotunately with no compilation, I rebuilt the new sif. file based on the modified sandbox directory:
singularity build --sandbox cfdem2.sif my_sbox/
However, as you know this is just adding a solver into the directories not adding it in a executable form. So what is your opinion for my problem? How I can compile a new solver on my container just the same as the way Im doing on my laptop (ubuntu)?
Every help in this regard is appreciated.
M

Madeinspace June 30, 2020 17:14

Hi mostanad,


Were you able to fix this issue? I am currently on the verge of installing OpenFOAM on a singularity container and still struggling with it. But if I can't compile my own solver using singularity container then there is simply no point in doing it. What you have reported, is this an usual issue with the container?



Do you have a documentation or weblinks to install OF in cluster usign singularity container. I would really appereciate if you could share it.


Best regards,

mostanad July 1, 2020 03:25

Quote:

Originally Posted by Madeinspace (Post 776480)
Hi mostanad,


Were you able to fix this issue? I am currently on the verge of installing OpenFOAM on a singularity container and still struggling with it. But if I can't compile my own solver using singularity container then there is simply no point in doing it. What you have reported, is this an usual issue with the container?



Do you have a documentation or weblinks to install OF in cluster usign singularity container. I would really appereciate if you could share it.


Best regards,


Hi James,
Yes. Finally, I became able to modify my container based on my developed solver. If you have your singularity container in which OpenFOAM has been installed you should work with sandbox and try to open it as a writable mode. In the below, you can find the procedure for this. However, I should note that you should have the container with original OpenFOAM source codes within it:
singularity build --sandbox my_sbox YourSifFile.sif (a folder with name: my_sbox is generated)

sudo singularity shell --writable my_sbox (making change in folder would be possible by this line, be careful to do this step in root)

copy your developed solver or make change in the existing source codes
source bashrc (which can be elsewhere in your container and you should give the address)
compile you source code or your solver as you did it before in your ubuntu system

ctrl+d (to exit)
singularity build OpenFoam_modified.sif my_sbox
By the last line, your modified singularity image file (i.e., sif) would be generated.

ves October 6, 2020 15:45

solvers not compiled from sandbox
 
[bes@localhost ~]$ cd OPENFOAM_8_SINGULARITY
[bes@localhost OPENFOAM_8_SINGULARITY]$ singularity shell --writable my_sbox
Singularity my_sbox:~/OPENFOAM_8_SINGULARITY> source /opt/openfoam8/etc/bashrc
Singularity my_sbox:~/OPENFOAM_8_SINGULARITY> echo $FOAM_RUN
/home/bes/run
Singularity my_sbox:~/OPENFOAM_8_SINGULARITY> cd $FOAM_RUN
Singularity my_sbox:~/run> cd OpenFOAM-8 #folder with first custom solver (varRhoTurbVOF_2)
Singularity my_sbox:~/run/OpenFOAM-8> bash ./Allwmake
./Allwmake: line 66: cd: ../turbulenceDamping: No such file or directory
wmakeLnIncludeAll error: file 'Make/options' does not exist
wmake: 'Make' directory does not exist in /home/bes/run/OpenFOAM-8
Searching up directories tree for Make directory
wmake error: could not find Make directory
Singularity my_sbox:~/run/OpenFOAM-8> bash ./Allwclean
./Allwclean: line 64: cd: ../turbulenceDamping: No such file or directory
wclean: 'Make' directory does not exist in /home/bes/run/OpenFOAM-8
Searching up directories tree for Make directory
wclean error: could not find Make directory
Singularity my_sbox:~/run/OpenFOAM-8> cd ../
Singularity my_sbox:~/run> cd spillwayFlowUr #folder with second custom solver
Singularity my_sbox:~/run/spillwayFlowUr> bash ./Allwmake
Making dependency list for spillwayFlow.C could not open file fvCFD.H for source file spillwayFlow.C due to No such file or directory

Wat's wrong?


All times are GMT -4. The time now is 09:56.