From 4d7be99d15cc4db13eea2d3a3eb12b9e77ab2e9d Mon Sep 17 00:00:00 2001 From: "christophe.benoit@onera.fr" Date: Mon, 2 Sep 2024 14:43:38 +0200 Subject: [PATCH] Distributor2: corr. init maxfloat --- Cassiopee/Converter/Converter/Converter.py | 2 ++ Cassiopee/Distributor2/Distributor2/gradient.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cassiopee/Converter/Converter/Converter.py b/Cassiopee/Converter/Converter/Converter.py index 6e15abbe3..b90b449ce 100644 --- a/Cassiopee/Converter/Converter/Converter.py +++ b/Cassiopee/Converter/Converter/Converter.py @@ -620,6 +620,8 @@ def _initVarByEq__(a, eq): eq = eq.replace('tan(', 'numpy.tan(') eq = eq.replace('atan(', 'numpy.atan(') eq = eq.replace('exp(', 'numpy.exp(') + eq = eq.replace('degrees(', 'numpy.degrees(') + eq = eq.replace('arctan2(', 'numpy.arctan2(') #eq = eq.replace('and(', 'numpy.logical_and(') eq = eq.replace('logical_and(', 'numpy.logical_and(') diff --git a/Cassiopee/Distributor2/Distributor2/gradient.cpp b/Cassiopee/Distributor2/Distributor2/gradient.cpp index e78391bd4..161f36429 100644 --- a/Cassiopee/Distributor2/Distributor2/gradient.cpp +++ b/Cassiopee/Distributor2/Distributor2/gradient.cpp @@ -76,9 +76,9 @@ void K_DISTRIBUTOR2::gradient( FldArrayI dis(nb); FldArrayI dis1(nb); - // Init, on repartis les blocs par taille decroissante + // Init, on repartit les blocs par taille decroissante // Puis sur les procs les moins charges (bin-packing) - FldArrayF nbPtsPerProcs(nbNodePerProc); + FldArrayF nbPtsPerProcs(NProc); nbPtsPerProcs.setAllValuesAtNull(); E_Float* nbPtsPerProcsp = nbPtsPerProcs.begin(); @@ -106,10 +106,10 @@ void K_DISTRIBUTOR2::gradient( } else { - E_Int kless = 0; E_Float minProc = 1.e6; + E_Int kless = 0; E_Float minProc = K_CONST::E_MAX_FLOAT; for (E_Int k = 0; k < NProc; k++) { - if (nbPtsPerProcsp[k] < minProc) + if (nbPtsPerProcsp[k] < minProc) { kless = k; minProc = nbPtsPerProcsp[k]; } } dis1[j] = kless;