diff --git a/.github/workflows/of2506.yml b/.github/workflows/of2506.yml index 05ba709c..7e4e265a 100644 --- a/.github/workflows/of2506.yml +++ b/.github/workflows/of2506.yml @@ -38,17 +38,26 @@ jobs: with: detached: true - - name: Compile and Test + - name: Compile run: | source /usr/lib/openfoam/openfoam2506/etc/bashrc mkdir -p $FOAM_USER_LIBBIN ./Allwmake + + - name: Test in serial + run: | + source /usr/lib/openfoam/openfoam2506/etc/bashrc git clone https://github.com/FoamScience/foamUT $FOAM_FOAMUT - sed -i 's/mpirun/mpirun --oversubscribe/g' $FOAM_FOAMUT/Alltest ln -s "$PWD"/tests/adaptiveFvMeshTests "$FOAM_FOAMUT/tests/adaptiveFvMeshTests" rm -rf "$FOAM_FOAMUT/cases" cp -r tests/testCases "$FOAM_FOAMUT/cases" cd $FOAM_FOAMUT || exit 1 rm -rf tests/exampleTests - ./Alltest "$@" + ./foamut if [ -f $FOAM_FOAMUT/tests/adaptiveFvMeshTests/log.wmake ]; then cat $FOAM_FOAMUT/tests/adaptiveFvMeshTests/log.wmake; fi + + - name: Test in parallel + run: | + source /usr/lib/openfoam/openfoam2506/etc/bashrc + cd $FOAM_FOAMUT || exit 1 + ./foamut --parallel --mpirun-options oversubscribe,use-hwthread-cpus diff --git a/Allclean b/Allwclean similarity index 100% rename from Allclean rename to Allwclean diff --git a/Allwmake b/Allwmake index 79e23c9f..1549a02f 100755 --- a/Allwmake +++ b/Allwmake @@ -29,11 +29,13 @@ fi #------------------------------------------------------------------------------ +wmake src/lagrangian wmake src/loadPolicies wmake src/cpuLoad wmake src/errorEstimators wmake src/dynamicMesh wmake src/dynamicFvMesh +wmake src/functionObjects wmake applications/utilities/updateMesh wmake applications/solvers/combustion/reactingDyMFoam diff --git a/src/cpuLoad/cpuLoadPolicy/cpuLoadPolicy.C b/src/cpuLoad/cpuLoadPolicy/cpuLoadPolicy.C index d36ce98f..a78269eb 100644 --- a/src/cpuLoad/cpuLoadPolicy/cpuLoadPolicy.C +++ b/src/cpuLoad/cpuLoadPolicy/cpuLoadPolicy.C @@ -41,11 +41,13 @@ namespace Foam __attribute__((constructor)) void onCPULoadLib() { - WarningInFunction - << "'libamrCPULoad.so' library loaded. Some MPI calls are overrided just by loading this library!" - << nl << tab << "This is the case even if you don't use cpuLoad for load-balancing..." - << nl << tab << "Of course this is possible only when this library is loaded before real MPI libs." - << nl << endl; + if (Pstream::master()) { + WarningInFunction + << "'libamrCPULoad.so' library loaded. Some MPI calls are overriden just by loading this library!" + << nl << tab << "This is the case even if you don't use cpuLoad for load-balancing..." + << nl << tab << "Of course this is possible only when this library is loaded before real MPI libs." + << nl << endl; + } } } @@ -263,6 +265,24 @@ WRAP_MPI_FUNCTION( // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +namespace +{ + // Helper to parse time unit from string + Foam::TimeUnit parseTimeUnit(const Foam::word& unitStr) + { + if (unitStr == "nano" || unitStr == "nanoseconds" || unitStr == "ns") + { + return Foam::TimeUnit::Nano; + } + else if (unitStr == "milli" || unitStr == "milliseconds" || unitStr == "ms") + { + return Foam::TimeUnit::Milli; + } + // Default to microseconds + return Foam::TimeUnit::Micro; + } +} + Foam::cpuLoadPolicy::cpuLoadPolicy ( const fvMesh& mesh, @@ -270,9 +290,21 @@ Foam::cpuLoadPolicy::cpuLoadPolicy ) : loadPolicy(mesh, dict), - maxCycleLength_(dict.lookupOrDefault("maxLBCycleLength", 5*readLabel(dict.lookup("refineInterval")))), - isActive_(true) + maxCycleLength_(dict.getOrDefault