|
ug4
|
Say YOURUG4ROOT is the root directory of ug4 (it contains ugbase, plugin and so forth). Add the line source YOURUG4ROOT/scripts/shell/ugbash to your ~/.bash_profile or ~/.bashrc. (it depends on your system if .bashrc or .bash_profile is used. See also here.)
source .bashrc or source .bash_profile) or just open a new shell to make your changes effective.$UG4_ROOT will be set automatically to YOURUG4ROOT.$UG4_ROOT/scripts/shell and $UG4_ROOT/bin will be added to your path. That means you can call ugshell from everywhere.ugbash makes some additional bash commands available:
cdug will change directory to UG4_ROOT. cdug subdir will change directory to UG4_ROOT/subdir (completion possible).ugbasegrep "the stuff i search" will do a grep-search for "the stuff i search" in ug4/ugbase, same for ugpluginsgrep in ug4/plugins.ugrelib will delete ug4/lib/*, ug4/bin/ugshell and ug4/bin/plugins/*, so you can re-link ugshell (sometimes necessary).The standard bash prompt is not very descriptive, so add source YOURUG4ROOT/scripts/shell/prompt to .bashrc / .bash_profile for a nicer bash prompt. That way you'll always see in which path you are (also in the title of the console). It's also covered here .
When using ugbash, you have additional completion (used with tab):
myfile.lua when you entered something like ugshell -ex myfile.lua - and hit 'tab', every parameter in your myfile.lua will be completed that is used in util.GetParamNumber etc.. ugcmake, which is an alias to cmake, but adds completion of a lot of our parameters for ug4, like -DEMBEDDED_PLUGINS= or -DCMAKE_TOOLCHAIN_FILE=. cdug: subdirectories are completed. ugsubmit xprun is a easy script to put each MPI process in its own console. You can even do simple parallel debugging with it. The opens e.g. 4 xterm windows and adjusts size & position so that they fit on the screen inside the windows, a mpi program is started. To adjust window position and max size, see xtermrun. You can access your PID by the variable $PID Example: xprun 4 echo 'hello, world! i am processor $PID'
For debugging, use e.g.
With outproc -1 you ensure that every process will put out data.
For more complex programs, you will need a real parallel debugger like DDT.