Skip to content

Instantly share code, notes, and snippets.

View NK-Nikunj's full-sized avatar

Nikunj Gupta NK-Nikunj

View GitHub Profile
@NK-Nikunj
NK-Nikunj / run_main_on_hpx.cpp
Created March 14, 2018 18:04
Running main on an hpx thread
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <stdlib.h>
int __argc = 0;
char** __argv = nullptr;
void set_argc_argv(int argc, char* argv[], char* env[])
{
@NK-Nikunj
NK-Nikunj / unexpected_output.cpp
Created March 19, 2018 14:33
Try running, ./unexpected_output --hpx:info
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/include/util.hpp>
int hpx_main()
{
return hpx::finalize();
}
int main()
@NK-Nikunj
NK-Nikunj / hpx:print-counter_error
Created March 19, 2018 15:58
Result when running with commandline option print counter
hpx::init: exception caught: the required argument for option '--hpx:print-counter' is missing
terminate called after throwing an instance of 'std::runtime_error'
what(): partitioner::setup_pools: Default pool default has no threads assigned. Please rerun with --hpx:threads=X and check the pool thread assignment
Aborted (core dumped)
@NK-Nikunj
NK-Nikunj / hpx:version_error
Created March 19, 2018 16:00
Result when running --hpx:version_error
HPX - The C++ Standard Library for Parallelism and Concurrency
(A general purpose parallel C++ runtime system for distributed applications
of any scale).
Copyright (c) 2007-2018, The STE||AR Group,
http://stellar-group.org, email:hpx-users@stellar.cct.lsu.edu
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)
@NK-Nikunj
NK-Nikunj / hpx:exit_error
Created March 19, 2018 16:01
Result when running --hpx:exit
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::unknown_option> >'
what(): unrecognised option '--hpx:exit'
Aborted (core dumped)
@NK-Nikunj
NK-Nikunj / hpx:version_error_init_globally
Created March 19, 2018 16:05
Error when running --hpx:version with init_globally
HPX - The C++ Standard Library for Parallelism and Concurrency
(A general purpose parallel C++ runtime system for distributed applications
of any scale).
Copyright (c) 2007-2018, The STE||AR Group,
http://stellar-group.org, email:hpx-users@stellar.cct.lsu.edu
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)
@NK-Nikunj
NK-Nikunj / hpx:print-counter_error_init_globally
Created March 19, 2018 16:06
Running --hpx:print-counter on init_globally
hpx::init: exception caught: the required argument for option '--hpx:print-counter' is missing
terminate called after throwing an instance of 'std::runtime_error'
what(): partitioner::setup_pools: Default pool default has no threads assigned. Please rerun with --hpx:threads=X and check the pool thread assignment
Aborted (core dumped)
@NK-Nikunj
NK-Nikunj / example.cpp
Created April 2, 2018 19:55
run: clang++ -o clang clang.cpp -fPIC -ldl
// #define _GNU_SOURCE
#include <dlfcn.h>
#include <cstdlib>
#include <cstdio>
#include <iostream>
int (*actual_main)(int, char**, char**);
void assign(int (*main)(int, char**, char**))
{
Creating library D:/gsoc18/hpx/build_2/Debug/lib/hpxd.lib and object D:/gsoc18/hpx/build_2/Debug/lib/hpxd.exp
2>topology.obj : error LNK2019: unresolved external symbol _hwloc_bitmap_alloc referenced in function "public: void __thiscall hpx::threads::topology::set_thread_affinity_mask(unsigned __int64,class hpx::error_code &)const " (?set_thread_affinity_mask@topology@threads@hpx@@QBEX_KAAVerror_code@3@@Z)
2>topology.obj : error LNK2019: unresolved external symbol _hwloc_bitmap_free referenced in function "public: void __thiscall hpx::threads::topology::set_thread_affinity_mask(unsigned __int64,class hpx::error_code &)const " (?set_thread_affinity_mask@topology@threads@hpx@@QBEX_KAAVerror_code@3@@Z)
2>topology.obj : error LNK2019: unresolved external symbol _hwloc_bitmap_snprintf referenced in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl hpx::threads::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,struct hpx::threads::hpx_hwloc_bitmap_wrapper co
1>------ Build started: Project: trying_msvc, Configuration: Debug x64 ------
1>Source1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl hpx::detail::throw_exception(enum hpx::error,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,long)" (__imp_?throw_exception@detail@hpx@@YAXW4error@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@11J@Z) referenced in function "bool __cdecl hpx::detail::apply_impl<struct hpx::lcos::base_lco_with_value<struct hpx::naming::id_type,struct hpx::naming::gid_type,struct hpx::traits::detail::component_tag>::set_value_action,struct hpx::naming::gid_type>(struct hpx::naming::id_type const &,struct hpx::naming::address &&,enum hpx::threads::thread_priority,struct hpx::naming::gid_type &&)" (??$appl