Skip to content

Instantly share code, notes, and snippets.

@sithhell
sithhell / gist:5768768
Created June 12, 2013 20:21
Example debug session for hpx examples.quickstart.hello_world showing the excess of https://github.com/STEllAR-GROUP/hpx/issues/784
[heller@sunshine debug]$ gdb bin/hello_world
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@sithhell
sithhell / uts_512.sh
Created April 25, 2013 14:47
Example batch scipt to run hpx on stampede
#!/bin/bash
#SBATCH -J hpx_uts_benchmark
#SBATCH -o hpx_uts_benchmark.o%j
#SBATCH -p normal
#SBATCH -N 32
#SBATCH -n 32
#SBATCH -t 10:00:00
HOSTS=`scontrol show hostname`
source $WORK/hpx_benchmarks/benchmarks/uts/sample_trees.sh
@sithhell
sithhell / 15_puzzle.cpp
Last active December 12, 2015 06:38
Example for a fully asynchronous solver for the fifteen puzzle. This example is explain at: http://stellar.cct.lsu.edu/?p=877
// Copyright (c) 2013 Thomas Heller
// Copyright (c) 2013 Andreas Schaefer
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <hpx/hpx_main.hpp>
#include <hpx/hpx.hpp>
#include <hpx/include/iostreams.hpp>
#! /bin/bash
#
# Copyright (c) 2011 Thomas Heller
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file BOOST_LICENSE_1_0.rst or copy at http://www.boost.org/LICENSE_1_0.txt)
#
#PBS -N jacobi_super_bench_vega
#PBS -l nodes=vega:ppn=48
#ifndef THREAD_POOL_H
#define THREAD_POOL_H
#include <vector>
#include <deque>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <future>
#include <boost/array.hpp>
namespace boost
{
template<typename T>
inline boost::array<T, 0>
make_array()
{
boost::array<T, 0> res;
@sithhell
sithhell / gist:3757788
Created September 20, 2012 19:18
Stacktrace for failed assertion regarding HPX issue https://github.com/STEllAR-GROUP/hpx/issues/539
[21:17:17]:heller@faui36i:/scratch/heller/build/hpx/debug:134:$ ./bin/jacobi -t12 --nx 1000 --ny 1000
[stack-trace]: 28 frames:
0x7f11226d8a76 : boost::backtrace::backtrace(unsigned long) + 0x80 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7f11226d8bda : boost::trace() + 0x1e in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7f11226d48ff : hpx::detail::backtrace() + 0x18 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7f11226d9213 : boost::exception_ptr hpx::detail::get_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x46 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7f11226d9703 : void hpx::detail::throw_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x38 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7f11226d4b74 : hpx::detail::assertion_failed_msg(char const*, char const*, char const*, char const*, long) + 0x238 in /scratch/heller/build/hpx/debug/li
@sithhell
sithhell / gist:3757779
Created September 20, 2012 19:16
Stacktrace for failed assertion regarding HPX issue https://github.com/STEllAR-GROUP/hpx/issues/539
[stack-trace]: 21 frames:
0x7fd3a43eda76 : boost::backtrace::backtrace(unsigned long) + 0x80 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43edbda : boost::trace() + 0x1e in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43e98ff : hpx::detail::backtrace() + 0x18 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43ee213 : boost::exception_ptr hpx::detail::get_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x46 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43ee703 : void hpx::detail::throw_exception<hpx::exception>(hpx::exception const&, std::string const&, std::string const&, long) + 0x38 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43e9b74 : hpx::detail::assertion_failed_msg(char const*, char const*, char const*, char const*, long) + 0x238 in /scratch/heller/build/hpx/debug/lib/hpx/libhpxd.so.1
0x7fd3a43e993c : hpx::detail::assertion_failed_msg(char const*, char const*, char
@sithhell
sithhell / gist:2627795
Created May 7, 2012 13:34
minimal Fusion splat implementation
#include <boost/fusion/include/size.hpp>
#include <boost/fusion/include/at_c.hpp>
#include <boost/move/move.hpp>
namespace tmp
{
template <typename Seq, int Size = boost::fusion::result_of::size<Seq>::value>
struct make_splat_impl;
@sithhell
sithhell / phoenix_lambda.cpp
Created March 28, 2012 09:01
Suggested phoenix solution -- getting rid of binding functions alltogether
#include <boost/assign/std/vector.hpp>
#include <boost/phoenix.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
template <typename F>
void g(F const & f)