CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

Proposal for a modification of the initscripts to make switching versions easier

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 21, 2007, 14:31
Default Hi! This is not a really a
  #1
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi!

This is not a really a bug, but I couldn't think of fitting place to post this.

One of the cool features of OF is that Debug/Opt, SP/DP and different MPI-implementations happily reside in the same directory tree side-by-side and can be chosen by the init-scripts. The downside is that one either has to edit the initiscripts and re-source them or has to work with symbolic links for different versions.

What I would propose is (I'm doing this for bashrc) is to add this function to .OpenFOAM-1.4.1/bashrc

SetDefault() {
TMP_DEFAULT=`eval echo \${${1}_DEFAULT}`
if [ "$TMP_DEFAULT" ]; then
eval "export $1=$TMP_DEFAULT"
else
eval "export $1=$2"
fi
}

and replace assignments like this

export WM_COMPILE_OPTION=Opt

with this

SetDefault WM_COMPILE_OPTION Opt

(I think this makes sense for WM_PRECISION_OPTION, WM_COMPILE_OPTION and WM_MPLIB)

Now if, for instance, one wants to switch one shell to the profiled, single-precision version with LAM he issues the commands

export WM_PRECISION_OPTION_DEFAULT=SP
export WM_COMPILE_OPTION=Prof
export WM_MPLIB=LAM
. .OpenFOAM-1.4.1/bashrc

The advantage of not editing the init-file would be that unpleasant surprises (starting a job with the wrong precision for instance) for other users living from that installation would be avoided
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 21, 2007, 14:53
Default I agree that we should make it
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
I agree that we should make it easier to switch between implementations and what we have at the moment in 1.4.2 is a set of aliases which allow us two switch between single and double precision using wmsp and wmdp, and between 32 and 64bit using wm32 and wm64. We could extend this mechanism to other build options such as opt, debug and prof and MPI implementations or use the more generic method you are proposing. I will think about this a bit more and plan for some such mechanism to be present in the next version.

Thanks

Henry
henry is offline   Reply With Quote

Old   December 21, 2007, 15:10
Default OK. Thanks for considering it.
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
OK. Thanks for considering it.

Merry Christmas and a happy new year.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proposal for an extension for the timeoptions of Utilities gschaider OpenFOAM Bugs 5 August 26, 2008 20:13
Cleaning up PATH and LD_LIBRARY_PATH when switching between different versions of OpenFOAM mbeaudoin OpenFOAM Bugs 1 March 12, 2008 05:29
find a Phd and a master degree proposal Sabbagh Main CFD Forum 1 January 7, 2007 01:49
Whats the best and easier mesh generator software? Pedro Clode FLUENT 4 November 29, 2006 03:11
Reference Format Guidelines - a Proposal Jonas Larsson CFD-Wiki 4 September 16, 2005 05:54


All times are GMT -4. The time now is 00:35.