|
[Sponsors] |
[Other] OpenFOAM using environment modules on an HPC |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 19, 2015, 08:59 |
OpenFOAM using environment modules on an HPC
|
#1 |
Member
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15 |
Hi Everyone,
This might be a bit of a vague question in some respects but I'll ask anyway since I've found very little detailed info on it. Installing OpenFOAM for use with environment modules which will allow all the settings/environment variables to be loaded/unloaded without opening a new shell. Does anyone know a good way to do this? I was thinking that perhaps the best method is to compile outside the module environment and then include just the required environment variables for running in the module file. This can then be loaded and unloaded since users won't need to compile anything other than user solvers. Is this possible or are their hidden settings I'm overlooking with regards to how everything runs? Thanks Andrew |
|
November 21, 2015, 17:22 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
You mean something like this?
http://modules.sourceforge.net/ (Welcome to the Environment Modules Project) Look what environment variables are modified by the (usual) $WM_PROJECT_DIR/etc/bashrc and write a module accordingly. |
|
November 22, 2015, 03:28 |
|
#3 |
Senior Member
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18 |
Hi Andrew,
Defining an environment module for OpenFOAM with all the needed variables is a pain, especially if you want options to be available, like single / double precision, MPI libraries, compilers, etc... What we do is to load the requirements using environment modules (compiler, MPI)' then source etc/bashrc. This does not allow to unload the OpenFOAM environment using the handy "module unload" command, but in my opinion it is by far the easiest option. Otherwise pipe the output of an "env" command before and after sourcing etc/bashrc, find the differences and add them to an environment module definition file. It's a pain and you'll need to go through the same process with each new version you install. Hope this helps, Francesco |
|
November 22, 2015, 07:47 |
|
#4 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
Quote:
In a normal OpenFOAM shell environment (not one manually defined with a module), you should have the alias "wmUNSET", which does exactly that, as defined in "etc/config/aliases.sh": Code:
# clear env alias wmUNSET='. $WM_PROJECT_DIR/etc/config/unset.sh' Bruno
__________________
|
||
November 22, 2015, 08:26 |
|
#5 |
Senior Member
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18 |
Hi Bruno,
Thanks for the hint, I'll give it a try. However I'm not sure you can source an external file within environment modules, especially a bash file, as the modules files are tcl files and what you can do inside them is quite limited. Cheers, Francesco |
|
November 22, 2015, 10:47 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Francesco,
I had a vague idea that the module system didn't allow for sourcing shell scripts... then that means that you actually load the modules and source the "etc/bashrc" script in the job script for the scheduler or even straight in the command line. And after a bit of Googling, I found that the FAQ for the modules project has on this very same topic: http://sourceforge.net/p/modules/wik...me-application There has been a brief proposition for such an implementation: http://www.openfoam.org/mantisbt/view.php?id=609#c1526 - but the problem is that this creates an additional maintenance issue or adds a dependency to "modules" being installed. Best regards, Bruno |
|
November 23, 2015, 09:38 |
|
#7 |
Member
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15 |
Thanks everyone, you've given me some ideas.
Thanks Bruno, hadn't seen wmUNSET before, this could be useful, it does seem though that openfoam are basically just doing what the environment modules are designed to do in their own way, so I'd be very happy to see openfoam incorporate the module system in to the installation though the added complexity and maintenance issues could be a problem so may never happen. Francesco, that does sound like a pain having to go through everything from he start every time you install a new version, I can see why people don't bother, what with everything else they have to do. If I ever come up with a better way doing this I'll be sure to post it. Thanks again, Andrew |
|
Tags |
hpc, modules |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM course for beginners | Jibran | OpenFOAM Announcements from Other Sources | 2 | November 4, 2019 09:51 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 15:24 |
running OpenFoam on a HPC | ce73stargazer | OpenFOAM | 2 | May 29, 2016 20:38 |
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | January 5, 2016 04:18 |
OpenFOAM benchmarks for HPC | tomislav_maric | OpenFOAM Running, Solving & CFD | 0 | April 21, 2010 18:39 |