Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major upgrade to python 3 & Jupyter nbclassic #172

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.8]
python-version: [3.8]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ install(TARGETS xpedite-pic DESTINATION "lib" COMPONENT libraries)

######################### Python bindings #############################

set(PYBIND11_PYTHON_VERSION 3.8 CACHE STRING "")
find_package(pybind11 REQUIRED)
pybind11_add_module(xpediteBindings lib/xpedite/pybind/Bindings.cpp lib/xpedite/framework/SamplesLoader.C)
install(TARGETS xpediteBindings DESTINATION "lib" COMPONENT libraries)
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ Due to this, sampling profilers typically end up profiling the least interesting

## Building <a name="building"></a>

To build xpedite, you will need [cmake](http://cmake.org/) 3.4 or later, [GNU gcc](https://gcc.gnu.org/) 5.2 or later, and a version 2.5 or later Linux kernel.

With cmake and g++ installed, to use xpedite, clone this repository and run the following from xpedite source dir:
To build xpedite, you will need a linux machine (kernel 2.5 or later) running on intel hardware with the following packages.
1. [cmake](http://cmake.org/) (3.4 or later)
2. [GNU gcc](https://gcc.gnu.org/) (5.2 or later)
3. [python 3](https://www.python.org/downloads/)
4. [pybind11](https://github.com/pybind/pybind11)
5. [python 3 venv](https://docs.python.org/3/library/venv.html)

With the above installed, to use xpedite, clone this repository and run the following from xpedite source dir:

```
$ ./build.sh # builds xpedite c++ library
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BUILD_TYPE=Release
BUILD_VIVIFY=0
BUILD_JAVA=0
VERBOSE=0
PYTHON_VERSION=2.7
PYTHON_VERSION=3.8

while true ; do
case "$1" in
Expand Down
7 changes: 6 additions & 1 deletion demo/Demo.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ int cpu {0};
bool multiThreaded {};
int txnCount {100};
bool randomize {};
bool pinMemory {};

void parseArgs(int argc_, char** argv_) {
int arg;
Expand All @@ -40,6 +41,9 @@ void parseArgs(int argc_, char** argv_) {
case 'c':
cpu = std::stoi(optarg);
break;
case 'l':
pinMemory = true;
break;
case '?':
default:
std::cerr << argv_[0] << " [-c <cpu>] [-t <txn count>] [-r] [-m]" << std::endl;
Expand All @@ -51,13 +55,14 @@ void parseArgs(int argc_, char** argv_) {
int main(int argc_, char** argv_) {
using namespace xpedite::demo;
parseArgs(argc_, argv_);
initialize();
std::cout
<< "\n========================================================================================\n"
<< " \txpedite " << (multiThreaded ? "Multi thread " : "") << "demo [txnCount - " << txnCount
<< " | randomization - " << (randomize ? "enabled" : "disabled")
<< " | cpu - " << cpu << "]"
<< " | pinMemory - " << (pinMemory ? "enabled" : "disabled") << "]"
<< "\n========================================================================================\n\n";
initialize(pinMemory);
if(multiThreaded) {
int trc;
std::thread t {[&trc]() {trc = runDemo(txnCount, randomize, cpu);}};
Expand Down
8 changes: 5 additions & 3 deletions demo/Demo.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ namespace xpedite { namespace demo {
constexpr uint64_t indexSize = 2048;
using Indices = std::array<uint64_t, indexSize>;

inline void initialize(size_t core_ = 0) {
if(mlockall(MCL_CURRENT | MCL_FUTURE)) {
std::cerr << "failed to mlock all pages" << std::endl;
inline void initialize(bool pinMemory_, size_t core_ = 0) {
if(pinMemory_) {
if(mlockall(MCL_CURRENT | MCL_FUTURE)) {
std::cerr << "failed to mlock all pages" << std::endl;
}
}
using namespace xpedite::framework;
if(!xpedite::framework::initialize("xpedite-appinfo.txt", {AWAIT_PROFILE_BEGIN})) {
Expand Down
1 change: 1 addition & 0 deletions include/xpedite/probes/CallSite.H
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#pragma once
#include <sstream>
#include <cstdint>

namespace xpedite { namespace probes {

Expand Down
1 change: 1 addition & 0 deletions include/xpedite/probes/Probe.H
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <xpedite/util/Util.H>
#include <xpedite/probes/CallSite.H>
#include <xpedite/probes/RecorderCtl.H>
#include <cstdint>

namespace xpedite { namespace probes {

Expand Down
1 change: 1 addition & 0 deletions include/xpedite/probes/ProbeKey.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#pragma once
#include <string>
#include <cstdint>

namespace xpedite { namespace probes {

Expand Down
1 change: 1 addition & 0 deletions include/xpedite/probes/RecorderCtl.H
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once
#include <xpedite/probes/CallSite.H>
#include <xpedite/probes/Recorders.H>
#include <cstdint>

using XpediteRecorder = void (*)(const void*, uint64_t);
using XpediteDataProbeRecorder = void (*)(const void*, uint64_t, __uint128_t);
Expand Down
1 change: 1 addition & 0 deletions include/xpedite/probes/Recorders.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma once
#include <xpedite/platform/Builtins.H>
#include <array>
#include <cstdint>

extern "C" {

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
eval set -- "$ARGS"
ENABLE_PMU=0
VERBOSE=0
PYTHON_VERSION=2
PYTHON_VERSION=3

while true ; do
case "$1" in
Expand Down
4 changes: 2 additions & 2 deletions jni/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sourceSets {
}

task xpediteJar(type: Jar) {
baseName = 'xpedite'
archiveBaseName = 'xpedite'
exclude(['**/demo/**'])
manifest {
attributes(
Expand All @@ -42,7 +42,7 @@ task xpediteJar(type: Jar) {
task demoJar(type: Jar) {
include(['**/demo/**'])
exclude(['**/com/xpedite/probes'])
baseName = 'xpediteDemo'
archiveBaseName = 'xpediteDemo'
manifest {
attributes(
'Implementation-Title': 'Xpedite Demo Jar',
Expand Down
1 change: 1 addition & 0 deletions lib/xpedite/framework/StorageMgr.H
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#pragma once
#include <string>
#include <cstdint>

namespace xpedite { namespace framework {

Expand Down
Loading
Loading