Giter Club home page Giter Club logo

hpxmp's People

Contributors

brycelelbach avatar kempj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hpxmp's Issues

Tied and untied Tasks

Currently, tied tasks share the psuedo thread ID of the parent that created it, but the task may actually switch to another OS thread. Other dependencies are not implemented.

switch from using started to hpx::get_runtime_ptr()

hpx::get_runtime_ptr() can be called on the main thread and will return NULL if HPX is not running. This will be required for nested parallelism and interaction with a hybrid code that may or may not start hpx itself.

Implement all scheduling policies for for loops

Currently only the default static scheduler is tested. The Intel runtime is similar for many loops to the openUH function calls, but I want to make/use a template and move it to a separate header/cpp file.

Barrier Hangs in EPCC

If the number of iterations is 4 or 5, it runs, but higher than that, including the default of 20, the program locks up indefinitely.

hpx::threads::set_thread_data has not been declared

I get the following error with the latest hpx:

g++ -g -fPIC -c hpxMP.cpp -o hpxMP.o `pkg-config --cflags --libs hpx_application`
In file included from hpxMP.h:8:0,
                 from hpxMP.cpp:7:
hpx_runtime.h:53:21: error: ‘hpx::threads::set_thread_data’ has not been declared
 using hpx::threads::set_thread_data;
                     ^
hpx_runtime.h:54:21: error: ‘hpx::threads::get_thread_data’ has not been declared
 using hpx::threads::get_thread_data;
                     ^
Makefile:28: recipe for target 'hpxMP.o' failed
make: *** [hpxMP.o] Error 1

Do I have to configure HPX in some way for this to work?

Threadprivate variables

This needs to be implemented in the intel version in order to use private/firstprivate variables with parallel regions and for loops.

Nested Parallelism

This is currently unimplemented. There is a function called before each parallel region __ompc_can_fork() which currently returns false if the runtime is currently already in a parallel region. This prevents fork from being called again, and forces the serial version to be run.

There are also several unimplemented nested specific functions: omp_init_nest_lock, omp_destroy_nest_lock, omp_set_nest_lock, omp_unset_nest_lock, omp_test_nest_lock, omp_set_nested

This will likely need to be done before trying to make sure hpx + OpenMP hybrid codes run correctly.

segfault if omp library is called before first parallel region

for example. if omp_get_max_threads is called before the first parallel region, it tries to access the number of threads, which is stored in the main hpx_runtime object, which is not initialized until the first time fork is called.

OpenUH does all initialization at startup. Doing somehing similar might work. Or maybe test to see if the runtime is running before accessing it.

use of hpx::lcos::local::spinlock in non-hpx thread

Currently, all locks are implemented using hpx::lcos::local::spinlock. This fails whenever an openMP lock is initialized outside of a parallel region.

The lock should also persist between parallel regions.

Running hybrid HPX/OMP code

a85879b does help in some way. Namely, the following code works:

#include <iostream>
#include <hpx/hpx_main.hpp>
#include <hpx/include/parallel_for_each.hpp>

//---------------------------------------------------------------------------
int main() {
    std::vector<int> x(10);

#pragma omp parallel for
    for(int i = 0; i < 10; ++i)
        x[i] = i;

    hpx::parallel::for_each(
            hpx::parallel::par,
            x.begin(), x.end(),
            [](int v) {
                std::cout << v << "\n";
            });
}

The output is:

$ LD_PRELOAD=/home/demidov/work/stellar/hpxMP/libiomp5.so ./hello1 

0
1
2
3
4
5
6
7
8
9

The following however does not work (the difference is in HPX initialization method):

#include <iostream>
#include <hpx/hpx_init.hpp>
#include <hpx/include/parallel_for_each.hpp>

//---------------------------------------------------------------------------
int hpx_main(boost::program_options::variables_map &vm) {
    std::vector<int> x(10);

#pragma omp parallel for
    for(int i = 0; i < 10; ++i)
        x[i] = i;

    hpx::parallel::for_each(
            hpx::parallel::par,
            x.begin(), x.end(),
            [](int v) {
                std::cout << v << "\n";
            });

    return hpx::finalize();
}
//---------------------------------------------------------------------------
int main(int argc, char *argv[]) {
    boost::program_options::options_description
       options("Usage: " HPX_APPLICATION_STRING " [options]");

    return hpx::init(options, argc, argv);
}

The output is:

$ LD_PRELOAD=/home/demidov/work/stellar/hpxMP/libiomp5.so ./hello2
HPX OpenMP runtime has started
{stack-trace}: 13 frames:
0x7fe33427b6e6  : hpx::termination_handler(int) + 0x86 in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe332a01210  : ??? + 0x7fe332a01210 in /usr/lib/libpthread.so.0
0x7fe33438870d  : ??? + 0x7fe33438870d in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe334372a18  : hpx::threads::threadmanager_impl<hpx::threads::policies::local_priority_queue_scheduler<boost::mutex, hpx::threads::policies::lockfree_fifo, hpx::threads::policies::lockfree_fifo, hpx::threads::policies::lockfree_lifo>, hpx::threads::policies::callback_notifier>::run(unsigned long) + 0x558 in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe3342c7ca1  : hpx::runtime_impl<hpx::threads::policies::local_priority_queue_scheduler<boost::mutex, hpx::threads::policies::lockfree_fifo, hpx::threads::policies::lockfree_fifo, hpx::threads::policies::lockfree_lifo>, hpx::threads::policies::callback_notifier>::start(hpx::util::function<int (), void, void> const&, bool) + 0x391 in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe3342b5f4c  : hpx::runtime_impl<hpx::threads::policies::local_priority_queue_scheduler<boost::mutex, hpx::threads::policies::lockfree_fifo, hpx::threads::policies::lockfree_fifo, hpx::threads::policies::lockfree_lifo>, hpx::threads::policies::callback_notifier>::run(hpx::util::function<int (), void, void> const&) + 0xc in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe334246daf  : ??? + 0x7fe334246daf in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe33424957d  : ??? + 0x7fe33424957d in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x7fe33424ac1d  : hpx::detail::run_or_start(hpx::util::function<int (boost::program_options::variables_map&), void, void> const&, boost::program_options::options_description const&, int, char**, std::vector<std::string, std::allocator<std::string> > const&, hpx::util::function<void (), void, void> const&, hpx::util::function<void (), void, void> const&, hpx::runtime_mode, bool) + 0x28d in /home/demidov/work/hpx/build/lib/libhpx.so.0
0x40cb33        : ??? + 0x40cb33 in ./hello2
0x7fe330a98040  : __libc_start_main + 0xf0 in /usr/lib/libc.so.6
0x40c8a9        : ??? + 0x40c8a9 in ./hello2
{what}: Segmentation fault
{config}:
  HPX_HAVE_NATIVE_TLS=ON
  HPX_HAVE_STACKTRACES=ON
  HPX_HAVE_COMPRESSION_BZIP2=OFF
  HPX_HAVE_COMPRESSION_SNAPPY=OFF
  HPX_HAVE_COMPRESSION_ZLIB=OFF
  HPX_HAVE_PARCEL_COALESCING=ON
  HPX_PARCELPORT_IPC=OFF
  HPX_PARCELPORT_IBVERBS=OFF
  HPX_HAVE_VERIFY_LOCKS=OFF
  HPX_HAVE_HWLOC=ON
  HPX_HAVE_ITTNOTIFY=OFF
  HPX_RUN_MAIN_EVERYWHERE=OFF
  HPX_LIMIT=5
  HPX_ACTION_ARGUMENT_LIMIT=5
  HPX_COMPONENT_CREATE_ARGUMENT_LIMIT=5
  HPX_FUNCTION_ARGUMENT_LIMIT=8
  HPX_LOCK_LIMIT=5
  HPX_TUPLE_LIMIT=8
  HPX_WAIT_ARGUMENT_LIMIT=5
  HPX_PARCEL_MAX_CONNECTIONS=512
  HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY=4
  HPX_INITIAL_AGAS_LOCAL_CACHE_SIZE=256
  HPX_AGAS_LOCAL_CACHE_SIZE_PER_THREAD=32
  HPX_PREFIX (configured)=/home/demidov/work/hpx/build
  HPX_PREFIX=/home/demidov/work/hpx/build
{version}: V0.9.10-trunk (AGAS: V3.0), Git: c182b3f6007610102b0b66c81ee73579862fee89
{boost}: V1.57.0
{build-type}: release
{date}: Dec 23 2014 21:33:46
{platform}: linux
{compiler}: GNU C++ version 4.9.2
{stdlib}: GNU libstdc++ version 20141030
Aborted (core dumped)

One thing that is somewhat suspicious is that the line

HPX OpenMP runtime has started

is present in the second output but is missing from the first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.