Skip to content

Commit

Permalink
update by pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-at-orange committed Apr 9, 2024
1 parent f125637 commit 7aea7b0
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 38 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pack-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ jobs:
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
if [ -z "${{ github.event.inputs.mpi_implementation }}" ] ;
then
echo "MPI_IMPLEMENTATION=openmpi" >> "$GITHUB_ENV"
else
echo "MPI_IMPLEMENTATION=${{ github.event.inputs.mpi_implementation }}" >> "$GITHUB_ENV"
fi
if [ "${{ env.MPI_IMPLEMENTATION }}" = "openmpi" ]
then
export KHIOPS_MPI_EXTRA_FLAG="--allow-run-as-root"
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pack-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ jobs:
echo "ID=$ID" >> "$GITHUB_ENV"
VERSION=$(echo $PLATFORM_ID | cut -d":" -f2)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
if [ -z "${{ github.event.inputs.mpi_implementation }}" ] ;
then
echo "MPI_IMPLEMENTATION=openmpi" >> "$GITHUB_ENV"
else
echo "MPI_IMPLEMENTATION=${{ github.event.inputs.mpi_implementation }}" >> "$GITHUB_ENV"
fi
if [ "${{ env.MPI_IMPLEMENTATION }}" = "openmpi" ]
then
export KHIOPS_MPI_EXTRA_FLAG="--allow-run-as-root"
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions packaging/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ configure_file(${PROJECT_SOURCE_DIR}/packaging/common/KNI/template-README.md ${T
# replace MPIEXEC MPIEXEC_NUMPROC_FLAG and MPI_IMPL
configure_file(${PROJECT_SOURCE_DIR}/packaging/linux/common/khiops-env.in ${TMP_DIR}/khiops-env @ONLY
NEWLINE_STYLE UNIX)
configure_file(${PROJECT_SOURCE_DIR}/packaging/linux/debian/khiops-core/postinst.in ${TMP_DIR}/postinst @ONLY
NEWLINE_STYLE UNIX)

if(NOT IS_FEDORA_LIKE)
install(TARGETS MODL MODL_Coclustering RUNTIME DESTINATION usr/bin COMPONENT KHIOPS_CORE)
Expand Down
4 changes: 1 addition & 3 deletions packaging/linux/common/khiops-env.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ if [[ -z $KHIOPS_PROC_NUMBER ]]; then
KHIOPS_PROC_NUMBER=$(( $(lscpu -b -p=Core,Socket | grep -v '^#' | sort -u | wc -l) + 1 ))
fi

${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG}

if command -v @MPIEXEC@ &> /dev/null
then
MPIEXEC_PATH=$(command -v @MPIEXEC@)
KHIOPS_MPI_COMMAND="${MPIEXEC_PATH} -bind-to hwthread -map-by core @MPIEXEC_NUMPROC_FLAG@ $KHIOPS_PROC_NUMBER"
KHIOPS_MPI_COMMAND="${MPIEXEC_PATH} -bind-to hwthread -map-by core ${KHIOPS_MPI_EXTRA_FLAG} @MPIEXEC_NUMPROC_FLAG@ $KHIOPS_PROC_NUMBER"
else
echo "We didn't find @MPIEXEC@ in the regular path. Parallel computation is unavailable: Khiops is launched in serial"
KHIOPS_MPI_COMMAND=""
Expand Down
7 changes: 0 additions & 7 deletions packaging/linux/debian/khiops-core/postinst

This file was deleted.

4 changes: 0 additions & 4 deletions packaging/linux/redhat/khiops-core.post

This file was deleted.

7 changes: 2 additions & 5 deletions packaging/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ set(CPACK_DEBIAN_KHIOPS_KNI_RECOMMENDS kni-doc)

# packages posinst and triggers

# set(CPACK_DEBIAN_KHIOPS_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/packaging/linux/debian/khiops/postinst")

set(CPACK_DEBIAN_KHIOPS_CORE_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/packaging/linux/debian/khiops-core/postinst")
set(CPACK_DEBIAN_KHIOPS_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/packaging/linux/debian/khiops/postinst")
set(CPACK_DEBIAN_KHIOPS_CORE_PACKAGE_CONTROL_EXTRA "${TMP_DIR}/postinst")
set(CPACK_DEBIAN_KNI_PACKAGE_CONTROL_EXTRA "${PROJECT_SOURCE_DIR}/packaging/linux/debian/kni/triggers")

# set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
Expand Down Expand Up @@ -163,8 +162,6 @@ set(CPACK_RPM_KHIOPS_CORE_PACKAGE_REQUIRES "util-linux")

# packages post/postun install scripts

# set(CPACK_RPM_KHIOPS_CORE_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/khiops-core.post")

set(CPACK_RPM_KHIOPS_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/khiops.post")
set(CPACK_RPM_KNI_POST_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/kni.post")
set(CPACK_RPM_KNI_POSTUN_INSTALL_SCRIPT_FILE "${PROJECT_SOURCE_DIR}/packaging/linux/redhat/kni.postun")
Expand Down
5 changes: 2 additions & 3 deletions src/Learning/DTForest/DTDecisionTreeCost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ double DTDecisionTreeCost::ComputeNodeCost(DTDecisionTreeNode* node, DTDecisionT

// Extraction du nombre d'intervalles de la regle de discretisation Is
// nPartNumber = oaGroups->GetSize();
attributeStats =
NULL; // NV9 cast(KWAttributeStats*,
// node->GetNodeAttributeStats()->Lookup(->LookupAttributeStats(sAttributeName));
attributeStats = NULL; // NV9 cast(KWAttributeStats*,
// node->GetNodeAttributeStats()->Lookup(->LookupAttributeStats(sAttributeName));

// cout << "sAttributeName = " << sAttributeName << endl;

Expand Down
14 changes: 6 additions & 8 deletions src/Learning/DTForest/DTDecisionTreeCreationTaskSequential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,12 @@ boolean DTDecisionTreeCreationTaskSequential::CreatePreparedAttributes(KWLearnin
AddSimpleMessage(sTmp + " ComputeTree time: \t" + DoubleToString(DTTimer_ComputeTree.GetElapsedTime()));
AddSimpleMessage(sTmp + " prepa attribut de CreatePreparedAttributes time: \t" +
DoubleToString(DTTimer_CreateAttribute.GetElapsedTime()));
AddSimpleMessage(
sTmp + " DiscretizeGFT time: \t" +
DoubleToString(DTTimerDiscretizeGFT.GetElapsedTime())); // a ajouter dasn la V10 + "\t" +
// IntToString(DTTimerDiscretizeGFT.GetLoop()));
AddSimpleMessage(
sTmp + " Discretize time: \t" +
DoubleToString(DTTimerDiscretize.GetElapsedTime())); // a ajouter dasn la V10 + "\t" +
// IntToString(DTTimerDiscretize.GetLoop()));
AddSimpleMessage(sTmp + " DiscretizeGFT time: \t" +
DoubleToString(DTTimerDiscretizeGFT.GetElapsedTime())); // a ajouter dasn la V10 + "\t" +
// IntToString(DTTimerDiscretizeGFT.GetLoop()));
AddSimpleMessage(sTmp + " Discretize time: \t" +
DoubleToString(DTTimerDiscretize.GetElapsedTime())); // a ajouter dasn la V10 + "\t" +
// IntToString(DTTimerDiscretize.GetLoop()));
AddSimpleMessage(sTmp + " BuildRootAttributeStats time: \t" +
DoubleToString(DTTimer_BuildRootAttributeStats.GetElapsedTime()));
AddSimpleMessage(sTmp + " SetUpInternalNode : \t" + DoubleToString(DTTimerTree1.GetElapsedTime()));
Expand Down
5 changes: 2 additions & 3 deletions src/Learning/DTForest/DTDecisionTreeGlobalCost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,8 @@ void DTDecisionTreeGlobalCost::ComputeHypotheticalAugmentedTreeCost(DTDecisionTr
else
{
// Nombre de valeurs distinctes pour l'attribut
nVariableValueNumber =
0; // NV9 cast(KWAttributeStats*,
// sourceNode->GetNodeClassStats()->LookupAttributeStats(sAttributeName))->GetDescriptiveStats()->GetValueNumber();
nVariableValueNumber = 0; // NV9 cast(KWAttributeStats*,
// sourceNode->GetNodeClassStats()->LookupAttributeStats(sAttributeName))->GetDescriptiveStats()->GetValueNumber();
}
assert(nVariableValueNumber > 0);

Expand Down
7 changes: 4 additions & 3 deletions src/Norm/base/MemoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,10 @@ void HeapClose()

// Visual C++: supression des Warning
#ifdef __MSC__
#pragma warning(disable : 6385) // disable C6385 warning (pour un controle excessif sur pHeap->fixedSizeHeapHeadSegments
// dans HeapCheckFixedSizeHeapLecture)
#endif // __MSC__
#pragma warning( \
disable : 6385) // disable C6385 warning (pour un controle excessif sur pHeap->fixedSizeHeapHeadSegments \
// dans HeapCheckFixedSizeHeapLecture)
#endif // __MSC__

// Verification d'un segment d'un FixedSizeHeap
int HeapCheckFixedSizeHeap(MemSegment* psegSearched)
Expand Down
4 changes: 2 additions & 2 deletions src/Norm/base/SystemResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,8 @@ longint MemGetFreePhysicalMemory()
if (pagesize == -1 or pagepurge == -1 or pagefree == -1)
return 0;
return pagesize * (pagepurge + pagefree);
#else // __APPLE_
// Lecture du fichier /proc/meminfo pour extraire la memoire dispoible et la memoire en cache
#else // __APPLE_ \
// Lecture du fichier /proc/meminfo pour extraire la memoire dispoible et la memoire en cache \
// On additionne la memoire disponible et 80% de la memoire cache (borne a 2Go)
FILE* file;
const int nLineSize = 4096;
Expand Down

0 comments on commit 7aea7b0

Please sign in to comment.