Skip to content

Commit

Permalink
Rename project to 'ib-scanner'
Browse files Browse the repository at this point in the history
  • Loading branch information
fruhland committed Jul 31, 2019
1 parent d309c89 commit df325e8
Show file tree
Hide file tree
Showing 32 changed files with 247 additions and 230 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
- stage: build
script: ./build.sh

before_deploy: tar -cf ibperf-monitor-${TRAVIS_TAG}.tar -C build/ ar/libCursesLib.a bin/IbPerfMon bin/WindowTest
before_deploy: tar -cf ib-scanner-${TRAVIS_TAG}.tar -C build/ ar/libcurses.a bin/scanner bin/window-test

deploy:
provider: releases
api_key: ${ACCESS_TOKEN}
file: ibperf-monitor-${TRAVIS_TAG}.tar
file: ib-scanner-${TRAVIS_TAG}.tar
skip_cleanup: true
overwrite: true
on:
repo: hhu-bsinfo/ibperf-monitor
repo: hhu-bsinfo/ib-scanner
branch: master
tags: true
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

IbPerfMonitor
ib-scanner
Copyright (C) 2018 Heinrich-Heine-Universitaet Duesseldorf,
Institute of Computer Science, Department Operating Systems

Expand All @@ -653,7 +653,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

IbPerfMonitor Copyright (C) 2018 Ruhland, Fabian (faruh100)
ib-scanner Copyright (C) 2018 Ruhland, Fabian (faruh100)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
# IbPerfMonitor: A monitoring tool for InfiniBand networks
# ib-scanner: A terminal based monitoring tool for InfiniBand

[![Build Status](https://travis-ci.org/hhu-bsinfo/ibperf-monitor.svg?branch=master)](https://travis-ci.org/hhu-bsinfo/ibperf-monitor)
<p align="center">
<img src="logo.png" height=250>
</p>

This project uses the libibmad- and libibnetdisc-libraries to automatically discover all InfiniBand devices in a
<p align="center">
<a href="https://travis-ci.org/hhu-bsinfo/ib-scanner"><img src="https://travis-ci.org/hhu-bsinfo/ib-scanner.svg?branch=master"></a>
<a href="https://isocpp.org/"><img src="https://img.shields.io/badge/C++-11-blue.svg"></a>
<a href="https://github.com/hhu-bsinfo/observatory/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-GPLv3-orange.svg"></a>
</p>

This project is based on <a href="https://github.com/hhu-bsinfo/detector">Detector</a>, which uses the libibmad- and libibnetdisc-libraries to automatically discover all InfiniBand devices in a
network and read their performance counters.

The goal of ib-scanner is to provide a simple to use frontend for Detector, allowing InfiniBand users to monitor multiple NICs at once and getting diagnostic information about their network.

# Build instructions

This project supports Linux only. It uses the libibmad- and libibnetdisc-libraries. CMake is used to generate build
scripts. To compile everything, just run *build.sh*.

# Run instructions

To start the project, just execute the compiled binary *IbPerfMon* with root privileges.
To start the project, just execute the compiled binary *scanner* with root privileges.

On a Debian-based system, you can run theses commands to build and run the project:

```
sudo apt install cmake libibmad-dev libibumad-dev libibnetdisc-dev libopensm-dev
./build.sh
sudo ./build/bin/IbPerfMon
sudo ./build/bin/scanner
```

It is also possible to start IbPerfMon in compatibility mode, where it does not need root privileges. However, it will only monitor local HCAs in this mode.
It is also possible to start ib-scanner in compatibility mode, where it does not need root privileges. However, it will only monitor local HCAs, by reading their counters from the filesystem, in this mode.

```
./build/bin/IbPerfMon --mode compat
./build/bin/scanner --mode compat
```

To get more information about the parameters, run:

````
./build/bin/scanner --help
````
67 changes: 34 additions & 33 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,45 @@ include(ExternalProject)

# Set version
execute_process(COMMAND git describe --tags --abbrev=0 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE IBPERFMON_VERSION ERROR_QUIET)
string(STRIP "${IBPERFMON_VERSION}" IBPERFMON_VERSION)
if (IBPERFMON_VERSION STREQUAL "")
set(IBPERFMON_VERSION "v0.0.0")
OUTPUT_VARIABLE IBSCANNER_VERSION ERROR_QUIET)
string(STRIP "${IBSCANNER_VERSION}" IBSCANNER_VERSION)
if (IBSCANNER_VERSION STREQUAL "")
set(IBSCANNER_VERSION "v0.0.0")
endif ()

# Set git revision
execute_process(COMMAND git log -1 --format=%h --date=short HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE IBPERFMON_GIT_REV ERROR_QUIET)
string(STRIP "${IBPERFMON_GIT_REV}" IBPERFMON_GIT_REV)
if (IBPERFMON_GIT_REV STREQUAL "")
set(IBPERFMON_GIT_REV "not available")
OUTPUT_VARIABLE IBSCANNER_GIT_REV ERROR_QUIET)
string(STRIP "${IBSCANNER_GIT_REV}" IBSCANNER_GIT_REV)
if (IBSCANNER_GIT_REV STREQUAL "")
set(IBSCANNER_GIT_REV "not available")
endif ()

# Set git branch
execute_process(COMMAND git rev-parse --symbolic-full-name --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE IBPERFMON_GIT_BRANCH ERROR_QUIET)
string(STRIP "${IBPERFMON_GIT_BRANCH}" IBPERFMON_GIT_BRANCH)
if (IBPERFMON_GIT_BRANCH STREQUAL "")
set(IBPERFMON_GIT_BRANCH "not available")
OUTPUT_VARIABLE IBSCANNER_GIT_BRANCH ERROR_QUIET)
string(STRIP "${IBSCANNER_GIT_BRANCH}" IBSCANNER_GIT_BRANCH)
if (IBSCANNER_GIT_BRANCH STREQUAL "")
set(IBSCANNER_GIT_BRANCH "not available")
endif ()

# Set build date
string(TIMESTAMP IBPERFMON_BUILD_DATE "%Y-%m-%d %H:%M:%S")
string(TIMESTAMP IBSCANNER_BUILD_DATE "%Y-%m-%d %H:%M:%S")

# Print build information

message("IbPerfMon ${IBPERFMON_VERSION} - git ${IBPERFMON_GIT_REV}(${IBPERFMON_GIT_BRANCH}), \
build date: ${IBPERFMON_BUILD_DATE}")
message("ib-scanner ${IBSCANNER_VERSION} - git ${IBSCANNER_GIT_REV}(${IBSCANNER_GIT_BRANCH}), \
build date: ${IBSCANNER_BUILD_DATE}")

# Set preprocessor defines
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIBPERFMON_VERSION='${IBPERFMON_VERSION}'\
-DIBPERFMON_GIT_REV='${IBPERFMON_GIT_REV}' -DIBPERFMON_GIT_BRANCH='${IBPERFMON_GIT_BRANCH}' \
-DIBPERFMON_BUILD_DATE='${IBPERFMON_BUILD_DATE}'")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIBSCANNER_VERSION='${IBSCANNER_VERSION}'\
-DIBSCANNER_GIT_REV='${IBSCANNER_GIT_REV}' -DIBSCANNER_GIT_BRANCH='${IBSCANNER_GIT_BRANCH}' \
-DIBSCANNER_BUILD_DATE='${IBSCANNER_BUILD_DATE}'")

# Set source directory variables
set(IBPERFMON_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
set(IBPERFMON_SRC_DIR "${IBPERFMON_ROOT_DIR}/src")
set(IBSCANNER_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
set(IBSCANNER_SRC_DIR "${IBSCANNER_ROOT_DIR}/src")

# Set output directory variables
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ar)
Expand All @@ -77,24 +77,25 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
# For development: Uncomment this line to compile with sanitizers to debug memory errors and leaks
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fno-omit-frame-pointer -fsanitize=address")

# Add IbPerfLib as external project
ExternalProject_Add(IbPerfLib_git
GIT_REPOSITORY https://github.com/hhu-bsinfo/ibperf-lib.git
GIT_TAG ${IBPERFMON_GIT_BRANCH}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/IbPerfLib
# Add Detector as external project
include(ExternalProject)

ExternalProject_Add(detector_git
GIT_REPOSITORY https://github.com/hhu-bsinfo/detector.git
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/detector
INSTALL_COMMAND "")

ExternalProject_Get_Property(IbPerfLib_git binary_dir)
ExternalProject_Get_Property(IbPerfLib_git source_dir)
ExternalProject_Get_Property(detector_git binary_dir)
ExternalProject_Get_Property(detector_git source_dir)

add_library(IbPerfLib STATIC IMPORTED ../src/IbPerfMon/BuildConfig.cpp ../src/IbPerfMon/BuildConfig.h)
set_property(TARGET IbPerfLib PROPERTY IMPORTED_LOCATION ${binary_dir}/ar/libIbPerfLib.a)
add_library(detector STATIC IMPORTED)
set_property(TARGET detector PROPERTY IMPORTED_LOCATION ${binary_dir}/ar/libdetector.a)

add_dependencies(IbPerfLib IbPerfLib_git)
add_dependencies(detector detector_git)

include_directories(${source_dir}/src)

# Add subdirectories
add_subdirectory(CursesLib)
add_subdirectory(WindowTest)
add_subdirectory(IbPerfMon)
add_subdirectory(curses)
add_subdirectory(window-test)
add_subdirectory(scanner)
15 changes: 0 additions & 15 deletions cmake/IbPerfMon/CMakeLists.txt

This file was deleted.

20 changes: 10 additions & 10 deletions cmake/CursesLib/CMakeLists.txt → cmake/curses/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>

project(CursesLib)
project(curses)
message(STATUS "Project " ${PROJECT_NAME})

include_directories(${IBPERFMON_SRC_DIR})
include_directories(${IBSCANNER_SRC_DIR})

set(SOURCE_FILES
${IBPERFMON_SRC_DIR}/CursesLib/WindowManager.cpp
${IBPERFMON_SRC_DIR}/CursesLib/Window.cpp
${IBPERFMON_SRC_DIR}/CursesLib/MessageWindow.cpp
${IBPERFMON_SRC_DIR}/CursesLib/OkMessageWindow.cpp
${IBPERFMON_SRC_DIR}/CursesLib/YesNoMessageWindow.cpp
${IBPERFMON_SRC_DIR}/CursesLib/ListWindow.cpp
${IBPERFMON_SRC_DIR}/CursesLib/MenuWindow.cpp
${IBPERFMON_SRC_DIR}/CursesLib/MenuItem.cpp)
${IBSCANNER_SRC_DIR}/curses/WindowManager.cpp
${IBSCANNER_SRC_DIR}/curses/Window.cpp
${IBSCANNER_SRC_DIR}/curses/MessageWindow.cpp
${IBSCANNER_SRC_DIR}/curses/OkMessageWindow.cpp
${IBSCANNER_SRC_DIR}/curses/YesNoMessageWindow.cpp
${IBSCANNER_SRC_DIR}/curses/ListWindow.cpp
${IBSCANNER_SRC_DIR}/curses/MenuWindow.cpp
${IBSCANNER_SRC_DIR}/curses/MenuItem.cpp)

add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})

Expand Down
15 changes: 15 additions & 0 deletions cmake/scanner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
project(scanner)
message(STATUS "Project " ${PROJECT_NAME})

include_directories(${IBSCANNER_SRC_DIR})

set(SOURCE_FILES
${IBSCANNER_SRC_DIR}/scanner/BuildConfig.cpp
${IBSCANNER_SRC_DIR}/scanner/MonitorWindow.cpp
${IBSCANNER_SRC_DIR}/scanner/Scanner.cpp)

add_executable(${PROJECT_NAME} ${SOURCE_FILES})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/infiniband/")

target_link_libraries(${PROJECT_NAME} detector curses -libverbs -libmad -libnetdisc)
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>

project(WindowTest)
project(window-test)
message(STATUS "Project " ${PROJECT_NAME})

include_directories(${IBPERFMON_SRC_DIR})
include_directories(${IBSCANNER_SRC_DIR})

set(SOURCE_FILES
${IBPERFMON_SRC_DIR}/CursesLib/test/WindowTest.cpp)
${IBSCANNER_SRC_DIR}/curses/test/WindowTest.cpp)

add_executable(${PROJECT_NAME} ${SOURCE_FILES})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

target_link_libraries(${PROJECT_NAME} CursesLib)
target_link_libraries(${PROJECT_NAME} curses)
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/CursesLib/ListWindow.cpp → src/curses/ListWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ListWindow.h"
#include "WindowManager.h"

namespace CursesLib {
namespace Curses {

ListWindow::ListWindow(uint32_t posX, uint32_t posY, uint32_t width, uint32_t height, const char *title) :
Window(posX, posY, width, height, title),
Expand Down
6 changes: 3 additions & 3 deletions src/CursesLib/ListWindow.h → src/curses/ListWindow.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef IBPERFMON_LISTWINDOW_H
#define IBPERFMON_LISTWINDOW_H
#ifndef IBSCANNER_LISTWINDOW_H
#define IBSCANNER_LISTWINDOW_H

#include <algorithm>
#include <vector>
#include "Window.h"

namespace CursesLib {
namespace Curses {

/**
* A Window, which contains a scrollable list of strings.
Expand Down
2 changes: 1 addition & 1 deletion src/CursesLib/MenuItem.cpp → src/curses/MenuItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <utility>
#include "MenuItem.h"

namespace CursesLib {
namespace Curses {

MenuItem::MenuItem(std::string name, std::function<void()> onClick, void *data) :
m_name(std::move(name)),
Expand Down
6 changes: 3 additions & 3 deletions src/CursesLib/MenuItem.h → src/curses/MenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

#ifndef IBPERFMON_MENUITEM_H
#define IBPERFMON_MENUITEM_H
#ifndef IBSCANNER_MENUITEM_H
#define IBSCANNER_MENUITEM_H

#include <string>
#include <vector>
#include <functional>

namespace CursesLib {
namespace Curses {

/**
* An item used in MenuWindows.
Expand Down
2 changes: 1 addition & 1 deletion src/CursesLib/MenuWindow.cpp → src/curses/MenuWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "WindowManager.h"
#include "MenuWindow.h"

namespace CursesLib {
namespace Curses {

MenuWindow::MenuWindow(uint32_t posX, uint32_t posY, uint32_t width, uint32_t height, const char *title) :
ListWindow(posX, posY, width, height, title) {
Expand Down
6 changes: 3 additions & 3 deletions src/CursesLib/MenuWindow.h → src/curses/MenuWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

#ifndef IBPERFMON_MENULIST_H
#define IBPERFMON_MENULIST_H
#ifndef IBSCANNER_MENULIST_H
#define IBSCANNER_MENULIST_H

#include <vector>
#include <ncurses.h>
#include "Window.h"
#include "MenuItem.h"
#include "ListWindow.h"

namespace CursesLib {
namespace Curses {

/**
* A ListWindow, which contains a scrollable list of item, that can have subitems.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "WindowManager.h"
#include "MessageWindow.h"

namespace CursesLib {
namespace Curses {

MessageWindow::MessageWindow(uint32_t posX, uint32_t posY, const char *title, const char *message) :
Window(posX, posY, 0, 0, title),
Expand Down
6 changes: 3 additions & 3 deletions src/CursesLib/MessageWindow.h → src/curses/MessageWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

#ifndef IBPERFMON_MSGBOX_H
#define IBPERFMON_MSGBOX_H
#ifndef IBSCANNER_MSGBOX_H
#define IBSCANNER_MSGBOX_H

#include <string>
#include <ncurses.h>
#include <vector>
#include "Window.h"

namespace CursesLib {
namespace Curses {

/**
* Window, which shows a multi-line text message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "WindowManager.h"
#include "OkMessageWindow.h"

namespace CursesLib {
namespace Curses {

OkMessageWindow::OkMessageWindow(uint32_t posX, uint32_t posY, const char *title, const char *message,
std::function<void()> onClick) :
Expand Down
Loading

0 comments on commit df325e8

Please sign in to comment.