Commit Graph

71 Commits

Author SHA1 Message Date
Mark Olesen
b264d2e913 CONFIG: reinstate FOAM_LD_LIBRARY_PATH adjustments (#2801)
- the special MacOS dlopen handling (commit f584ec97d0)
  did not fully solve the problem with SIP clearing.

  Eg, sourcing the RunFunctions (for runParallel) triggers SIP and
  clears DYLD_LIBRARY_PATH. With the cleared path it finds the dummy
  libraries: the dummy Pstream::init() fails.
2023-06-26 09:47:07 +02:00
Alexey Matveichev
f584ec97d0 ENH: reimplement Foam::dlOpen() for macOS (#2801)
- The Apple SIP (System Integrity Protection) clears environment
  variables, which affects the behaviour of dynamic library loading
  (the DYLD_LIBRARY_PATH env variable).

  OpenFOAM shadows this variable as FOAM_LD_LIBRARY_PATH, which has
  been used to restore DYLD_LIBRARY_PATH (eg, in RunFunctions script).

  However, this solution is not quite complete, as it
    (a) requires sourcing of RunFunctions file,
    (b) additional errors appear depending on a user workflow.

  This changeset alleviates the problem by also iterating through
  paths stored in the shadow variable when loading dynamic libraries
  (if the DYLD_LIBRARY_PATH is empty).
2023-06-14 13:55:38 +02:00
Mark Olesen
4284d02c99 CONFIG: accept -decompose-dict=xyz for Run functions and mpirunDebug
- interpret as '-decomposeParDict xyz' for simpler scripting:
  A empty value ("") as well as "none" or "false" values are ignored.

  Eg,
      unset decompDict
      if some_condition; then decompDict=decomposeParDict-12; fi

      runParallel -decompose-dict=$decompDict ...

ENH: more generous when scanning decomposeParDict for numberOfSubdomains

- assume file is in system/ directory if not otherwise found
2023-03-02 20:50:52 +01:00
Alexey Matveichev
e827c117e3 CONFIG: fixes for MacOS (#2555)
- introduce a FOAM_LD_LIBRARY_PATH variable to shadow
  DYLD_LIBRARY_PATH on MacOS.

  The DYLD_LIBRARY_PATH and LD_LIBRARY_PATH cannot be modified via sub
  shells etc when SIP is active. This helps circumvent these
  restrictions, which is obviously a hack, but seems to be required.

COMP: disable -ftrapping-math in geompack for MacOS
2022-08-19 12:52:11 +02:00
Mark Olesen
8b1514c99b GIT: relocate rawIOField to src/OpenFOAM (closer to IOField classes)
STYLE: RunFunctions - missed message for failure to find nFaces
2022-07-13 19:23:27 +02:00
Mark Olesen
525f77f8bb TUT: add constraint types for finiteArea tutorials
STYLE: accept '-proc' as shortcut in restore0Dir function
2022-05-10 21:16:09 +02:00
Mark Olesen
435be2e5ec CONFIG: improve flexibility of MPI specification
- it is now possible to include the selected mpi version in the
  top-level bashrc or prefs.sh file. For example,

      WM_MPLIB=OPENMPI-4.1.1  or  WM_MPLIB=openmpi-4.1.1

  after evaluation of the config.sh/mpi, this will define

      WM_MPLIB=OPENMPI-4.1.1  and  FOAM_MPI=openmpi-4.1.1

  During the wmake, the mpi-rules will first load the MPI 'family'
  rules (OPENMPI in this example) before trying to load
  version-specific rules if they exist.

  NOTE: the regular user-defined prefs system is unaffected by this
  change. This means it is still possible to use a file such as
  'prefs.openmpi' to define the preferred version instead or as well.
  However, it does mean inconsistent naming can be specified.
  For example, specify WM_MPLIB=OPENMPI-4.1.1 at the top-level but
  actually have FOAM_MPI=openmpi-4.0.6 in the prefs.openmpi file.
  This will make the value of WM_MPLIB misleading.

CONFIG: foamConfigurePaths support for sys-openmpi major version

CONFIG: cleanup any shadow env variables
2021-10-29 17:04:51 +02:00
Mark Olesen
e2be2289a1 ENH: finer granularity for CleanFunctions
- separate handling of auxiliary files vs time directories

- restore0Dir: avoid removing 0/ if 0.orig/ does not exist
2021-07-28 10:02:27 +02:00
Mark Olesen
853010309d ENH: replace tutorials/AutoTest with bin/foamTestTutorial
- additional -serial/-parallel option:
  prefer Allrun-serial or Allrun-parallel if available

- optional -output=DIR to preserve output

ENH: report missing tutorials/ directory in RunFunctions
2021-06-10 08:38:20 +02:00
Mark Olesen
03b0ca6f2e CONFIG: trap missing make command in canCompile (#2077) 2021-05-06 21:43:10 +02:00
Mark Olesen
51db3c85a7 ENH: add canCompile test to RunFunctions
- allow conditional skipping of tutorials (for example) if wmake or
  the expected compiler is not available
2020-06-09 00:55:58 +02:00
Mark Olesen
e6dfb39c66 STYLE: remove unnecessary stdout, stderr /dev/null redirects
- no stderr redirect needed:
    * 'command -v'

- no stdout/stderr redirect needed:
    * 'rm -f'

STYLE: consistent spacing after redirects
2019-11-06 10:44:36 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
c320892aa2 COMP: use '-n' instead of '-np' for runParallel (#1238)
- options '-n' and '-np' are synonymous, but some mpiexec versions may
  only recognize '-n' and not '-np'
2019-06-04 17:51:20 +02:00
Mark Olesen
52df9a2fee TUT: use mpiexec instead of mpirun for msmpi in RunFunctions (#1238) 2019-06-04 11:22:21 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
c5beee63f3 ENH: add isTrue function to RunFunctions
- check if the first argument corresponds to an OpenFOAM value for
  'true' (as per Switch).
  True == 't', 'y', 'true', 'yes', 'on'. Everything else is not true.

- when the first argument is '-dict', it initializes the value
  with a query via foamDictionary.
  Eg,
       isTrue -dict mydict -entry parallel

   ==> value=$(foamDictionary mydict -entry parallel -value)
       isTrue $value

   a missing entry is silently treated as false.

ENH: add getNumberOfPatchFaces function in RunFunctions

- simple extraction of nFaces from boundary file for given patch/region
2018-11-30 19:29:49 +01:00
Andrew Heather
59b4a77d23 TUT: RunFunctions - added protection for user shell customisations 2018-06-26 11:51:02 +01:00
Mark Olesen
6390c18381 ENH: suppress Info output for some cases (issue #722, #893)
- add additional control via a Foam::infoDetailLevel flag, which is
  supported by a 'DetailLevel' macro.  Eg,

      DetailLevel << "some information" << nl

- When infoDetailLevel is zero, the stdout for all Foam::system() calls
  are also redirected to stderr to prevent child output from
  appearing on the parent.

- close stdin before exec in system call.
2018-06-22 12:26:33 +02:00
Mark Olesen
6ac47e6db5 STYLE: consistent foamDictionary stderr redirect in RunFunctions 2018-06-19 13:56:30 +02:00
Mark Olesen
d637b6eb78 ENH: avoid parse problems caused by #calc directives (fixes #722)
- The additional output generated by #calc directives in the
  controlDict or decomposeParDict causes issues for the RunFunctions
  extraction of 'application' and 'numberOfSubdomains'.

  Avoid by using -disableFunctionEntries, which also has the side-effect
  of disabling '#include'.
2018-06-19 12:38:53 +02:00
Mark Olesen
fe140cd6c5 TUT: test mode not respected (closes #710)
- now replaced 'if ! isTest' with 'if notTest' for most cases.
2018-02-20 12:54:44 +01:00
Mark Olesen
9c38ad6ae4 TUT: relocate tutorial log analysis as functions for reuse in modules
- removed some unneeded tutorial files
2017-12-21 14:17:20 +01:00
Mark Olesen
590b319a78 TUT: 'restore0Dir -processors' with filtering of #include files 2017-11-04 14:59:59 +01:00
Mark Olesen
c792a9d7df TUT: script cleanup, provide cleanCase0 for commonly used operation 2017-10-12 19:20:56 +02:00
Mark Olesen
8005e2b4a2 ENH: add cloneParallelCase function into bin/tools/RunFunctions 2017-06-22 14:45:53 +01:00
Mark Olesen
b970ba0901 ENH: minor improvements to environment
- handle sourcing bashrc with a relative path (issue #383)
- handle sourcing from bash and zsh.
  Still need manual intervention when sourcing dash, sh, or ksh.
- replace grep in etc/cshrc with sed only
- logical instead of physical path for WM_PROJECT_DIR (issue #431).
  Doesn't seem to be possible for csh/tcsh.

  * Continue using physical locations when comparing directories,
    but not for the top-level FOAM_INST_DIR, WM_PROJECT_DIR.

- relocate WM_CC, WM_CXX overrides from etc/config.*/compiler
  to etc/config.*/settings to ensure that they are left untouched
  when etc/config.sh/compiler is sourced while making third-party
  packages (eg, gcc, llvm, CGAL).

- provide fallback FOAM_TUTORIALS setting in RunFunctions

STYLE: remove "~OpenFOAM" fallback as being too rare, non-obvious
2017-03-20 08:57:12 +01:00
Mark Olesen
0067c9e369 STYLE: avoid spurious messages when cloning cases
- either (or both) of 0/, 0.orig/ may exist, so error messages about
  one of them being missing is a bit misleading
2017-02-09 13:41:48 +01:00
Andrew Heather
9e8031f285 BUG: RunFunctions - updated retrieval of nProcs to suppress warning when no system/deomposeParDict 2017-02-03 12:27:50 +00:00
Mark Olesen
58fad3ab79 BUG: snappyHexMesh with -decomposeParDict option (issue #265)
- only occurs in combination with distributedTriSurfaceMesh in snappy.

- workaround similar to that previously used for surfaceRedistributePar
  (issue #60).

Minor adjustment of incompressible motorBike tutorial to detect use of
distributedTriSurfaceMesh.
2016-11-24 12:02:11 +01:00
Mark Olesen
9ab0406b47 BUG: tutorial RunFunctions ignore non-standard decomposeParDict (issue #279) 2016-10-28 13:22:19 +02:00
Mark Olesen
ba6f59a79e ENH: provide isParallel test in RunFunctions
- allows writing Allrun scripts that can be easily tested in
  serial or parallel
2016-10-07 18:00:00 +02:00
Andrew Heather
1fbcb686ff STYLE: Consistency updates 2016-09-23 16:52:46 +01:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
0a2c2d76de RunFunctions: corrected typo $SUFFIX -> $LOG_SUFFIX
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2176
2016-08-02 21:32:38 +01:00
Mark Olesen
a95ca8293a BUG: runParallel ignores presence of log file (closes #203)
- was a small typo
2016-08-02 18:31:50 +02:00
Henry Weller
5b38cb4862 bin/tools/RunFunctions: Simplified using the foamDictionary -value option 2016-06-10 20:24:12 +01:00
Henry Weller
2f84769710 bin/tools/RunFunctions: Updated to use foamDictionary 2016-06-10 18:02:26 +01:00
Mark Olesen
820f809bd5 STYLE: cleanup handling of 0.org directories (in parallel)
- remove duplicate 0/ files from the repository
2016-06-29 13:34:36 +02:00
Mark Olesen
dd60cfcd06 FIX: provide restore0Dir function to fix issue #159
- makes it easier to ensure the correct behaviour, consistently
2016-06-27 16:33:55 +02:00
Henry Weller
4bc77e6aff Sprucing up the tutorials folder and adding -dict to "collapseEdges"
Patch provided by Bruno Santos
Resolves patch application request http://www.openfoam.org/mantisbt/view.php?id=2015
2016-03-06 19:06:44 +00:00
Prashant
e0a0f94e6f ENH: added -decomposeParDict as argument to getNumberOfProcessors() 2016-05-06 11:25:11 +05:30
Andrew Heather
48caf88af9 STYLE: corrected header 2016-04-29 15:47:35 +01:00
andy
fd9d801e2d GIT: Initial commit after latest foundation merge 2016-04-25 11:40:48 +01:00
Henry Weller
cfa7678ba8 foamRunTutorials: Rationalized support for the "-test" option
RunFunctions: Added "isTest()" argument parsing function
tutorials: Updated Allrun scripts to propagate the "-test" option
tutorials: Removed the lower Alltest scripts and updated the Allrun to
    use the "isTest()" function to handle test-specific operation
2016-02-15 15:49:05 +00:00
Henry Weller
1507178a1b RunFunctions::getNumberOfProcessors: Added support for files included in decomposeParDict 2016-02-08 10:51:49 +00:00
Henry Weller
b3d47f0423 bin/tools/RunFunctions: runParallel now obtains the number of processors from numberOfSubdomains
in decomposeParDict.

This default number of processors may be overridden by the new "-np"
option to runParallel which must be specified before the application
name e.g.:

runParallel -np 4 pisoFoam
2016-01-27 14:19:25 +00:00
mattijs
2e7d7d1609 BUG: RunFunctions: missing fi. Renamed variable. Updated Allrun scripts 2015-12-08 14:35:02 +00:00
Andrew Heather
3f55f752fc GIT: Resolve conflict with upstream merge from Foundation 2015-12-07 17:07:20 +00:00
Henry Weller
26a2c1778a RunFunctions: Added -append and -overwrite options
-append: append to log file
-overwrite: overwrite log file
Original patch provided by Timm Severin
Resolves feature request http://www.openfoam.org/mantisbt/view.php?id=1919
2015-11-19 15:48:06 +00:00