Skip to content

Commit

Permalink
Remove bundled hwloc-1.2.1. Use either native Linux affinity support …
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Nov 21, 2011
1 parent 7ca1081 commit bc87a8f
Show file tree
Hide file tree
Showing 83 changed files with 14 additions and 72,615 deletions.
12 changes: 1 addition & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@

if HAVE_BUNDLED_HWLOC
SUBDIRS = hwloc-1.2.1
endif

ACLOCAL_AMFLAGS = -I m4 -I hwloc-1.2.1/config
ACLOCAL_AMFLAGS = -I m4

bin_PROGRAMS = htop
dist_man_MANS = htop.1
Expand Down Expand Up @@ -41,12 +37,6 @@ SUFFIXES = .h
BUILT_SOURCES = $(myhtopheaders)
htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h debug.h

if HAVE_BUNDLED_HWLOC
htop_LDADD = $(HWLOC_EMBEDDED_LDADD) $(HWLOC_EMBEDDED_LIBS)
AM_CFLAGS += $(HWLOC_EMBEDDED_CFLAGS)
AM_CPPFLAGS += $(HWLOC_EMBEDDED_CPPFLAGS)
endif

profile:
$(MAKE) all CFLAGS="-pg -O2"

Expand Down
4 changes: 2 additions & 2 deletions Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ in the source distribution for its full text.
#include <sched.h>
#include <time.h>

#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC
#include <hwloc/linux.h>
#endif

Expand Down Expand Up @@ -566,7 +566,7 @@ bool Process_setPriority(Process* this, int priority) {
return (err == 0);
}

#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC

Affinity* Process_getAffinity(Process* this) {
hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
Expand Down
4 changes: 2 additions & 2 deletions Process.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in the source distribution for its full text.
#include <sched.h>
#include <time.h>

#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC
#include <hwloc/linux.h>
#endif

Expand Down Expand Up @@ -196,7 +196,7 @@ void Process_toggleTag(Process* this);

bool Process_setPriority(Process* this, int priority);

#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC

Affinity* Process_getAffinity(Process* this);

Expand Down
4 changes: 2 additions & 2 deletions ProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ typedef struct ProcessList_ {
int kernelThreads;
int runningTasks;
#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC
hwloc_topology_t topology;
bool topologyOk;
#endif
Expand Down Expand Up @@ -195,7 +195,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable) {
fclose(file);
this->cpuCount = cpus - 1;

#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC
this->topologyOk = false;
int topoErr = hwloc_topology_init(&this->topology);
if (topoErr == 0) {
Expand Down
2 changes: 1 addition & 1 deletion ProcessList.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ typedef struct ProcessList_ {
int kernelThreads;
int runningTasks;

#ifdef HAVE_HWLOC
#ifdef HAVE_LIBHWLOC
hwloc_topology_t topology;
bool topologyOk;
#endif
Expand Down
2 changes: 0 additions & 2 deletions acinclude.m4

This file was deleted.

26 changes: 3 additions & 23 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -131,32 +131,12 @@ if test "x$enable_native_affinity" = xyes; then
[AC_MSG_RESULT([no])])
fi

##### hwloc
AC_ARG_ENABLE(system-hwloc, [AC_HELP_STRING([--enable-system-hwloc], [use the copy of hwloc from your system and not the one bundled with the htop sources. (hwloc required)])], ,enable_system_hwloc="no")
enable_xml=no
AC_ARG_ENABLE(hwloc, [AC_HELP_STRING([--enable-hwloc], [enable hwloc support for CPU affinity])],, test "x$enable_native_affinity" = xno && enable_hwloc="yes")
AC_ARG_ENABLE(hwloc, [AC_HELP_STRING([--enable-hwloc], [enable hwloc support for CPU affinity])],, enable_hwloc="no")
if test "x$enable_hwloc" = xyes
then
if test "x$enable_system_hwloc" = xyes
then
AC_CHECK_LIB([hwloc], [hwloc_linux_get_tid_cpubind], [], [missing_libraries="$missing_libraries libhwloc"])
AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"])

else
HWLOC_SETUP_CORE([hwloc-1.2.1], [hwloc_bundled=yes], [hwloc_bundled=no])
fi
AC_CHECK_LIB([hwloc], [hwloc_linux_get_tid_cpubind], [], [missing_libraries="$missing_libraries libhwloc"])
AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"])
fi
HWLOC_DO_AM_CONDITIONALS
AM_CONDITIONAL([HAVE_HWLOC], [test "x$hwloc_bundled" = "xyes" -o "x$hwloc_system" = "xyes"])
AM_CONDITIONAL([HAVE_BUNDLED_HWLOC], [test "x$hwloc_bundled" = "xyes"])
if test "x$hwloc_system" = "xyes"; then
AC_DEFINE([HAVE_SYSTEM_HWLOC], 1, [Have system hwloc])
AC_DEFINE([HAVE_HWLOC], 1, [Have hwloc])
elif test "x$hwloc_bundled" = "xyes"; then
AC_DEFINE([HAVE_BUNDLED_HWLOC], 1, [Use bundled hwloc])
AC_DEFINE([HAVE_HWLOC], 1, [Have hwloc])
fi
#####

AC_CONFIG_FILES([Makefile htop.1])
AC_OUTPUT
6 changes: 3 additions & 3 deletions htop.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void showHelp(ProcessList* pl) {
mvaddstr(15, 0, " F9 k: kill process/tagged processes P: sort by CPU%");
mvaddstr(16, 0, " ] F7: higher priority (root only) M: sort by MEM%");
mvaddstr(17, 0, " [ F8: lower priority (+ nice) T: sort by TIME");
#ifdef HAVE_HWLOC
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
if (pl->cpuCount > 1)
mvaddstr(18, 0, " a: set CPU affinity I: invert sort order");
else
Expand All @@ -144,7 +144,7 @@ static void showHelp(ProcessList* pl) {
mvaddstr(16, 0, " ] F7"); mvaddstr(16,40, " M");
mvaddstr(17, 0, " [ F8"); mvaddstr(17,40, " T");
mvaddstr(18,40, " F4 I");
#if HAVE_HWLOC
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
if (pl->cpuCount > 1)
mvaddstr(18, 0, " a:");
#endif
Expand Down Expand Up @@ -773,7 +773,7 @@ int main(int argc, char** argv) {
refreshTimeout = 0;
break;
}
#if (HAVE_HWLOC || HAVE_NATIVE_AFFINITY)
#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
case 'a':
{
if (pl->cpuCount == 1)
Expand Down
8 changes: 0 additions & 8 deletions hwloc-1.2.1/AUTHORS

This file was deleted.

27 changes: 0 additions & 27 deletions hwloc-1.2.1/COPYING

This file was deleted.

27 changes: 0 additions & 27 deletions hwloc-1.2.1/Makefile.am

This file was deleted.

0 comments on commit bc87a8f

Please sign in to comment.