Skip to content

Commit

Permalink
Distributor2: corr. init maxfloat
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Sep 2, 2024
1 parent 3baac7a commit 4d7be99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Cassiopee/Converter/Converter/Converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(')

Expand Down
8 changes: 4 additions & 4 deletions Cassiopee/Distributor2/Distributor2/gradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4d7be99

Please sign in to comment.