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

compilation error fix (hwloc_topology) #687

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
520d73e
commit of fft code
Dec 4, 2012
999104d
updated pull model
vamatya Dec 12, 2012
b8a3aad
testcode for fft-dataflow
vamatya Dec 17, 2012
52d325f
fft_commit
Dec 17, 2012
1fd2a20
resolving merge conflict
Dec 17, 2012
de4f0b3
test fft-dataflow
vamatya Dec 19, 2012
81522a4
bugfix
vamatya Dec 27, 2012
a3b2d0e
Merge branches 'master' and 'dd' into dd
vamatya Dec 27, 2012
8fb6b30
time counter
vamatya Dec 27, 2012
a12d88c
fft update
vamatya Jan 16, 2013
b9302d9
Merge branch 'master' into dd
vamatya Jan 16, 2013
1a169c6
Merge branch 'master' of https://github.com/STEllAR-GROUP/hpx into dd
vamatya Jan 16, 2013
308579f
primitive string processing, with dataflow objects
vamatya Jan 23, 2013
0d4d710
updates to tictactoe, str_srch
vamatya Jan 28, 2013
50b73cd
Merge branch 'master' into dd
vamatya Jan 28, 2013
39c2f25
Merge branch 'master' into dd
vamatya Jan 30, 2013
bad2d07
Fixing ABP queue compilation problems
hkaiser Jan 29, 2013
99c6d0d
Adding missing apply_c overloads, fixing a problem in existing nullar…
hkaiser Jan 26, 2013
18627dd
Allow to bind const function object instances
hkaiser Jan 28, 2013
01913fe
Replacing bulk async call with corresponding loop
hkaiser Jan 28, 2013
b212adf
Adding apply_continue
hkaiser Jan 28, 2013
9b1fe88
Removing superfluous #include
hkaiser Jan 28, 2013
2119bd4
Making action serializable
hkaiser Jan 28, 2013
b47ca8c
Making bind.hpp(PFO, ...) serializable - this may break existing code…
hkaiser Jan 28, 2013
fc6dc3a
Cosmetics
hkaiser Jan 28, 2013
9bb0884
Adding result_type to util::function, adding default constructor to a…
hkaiser Jan 28, 2013
af3e478
Refining is_serializable
hkaiser Jan 28, 2013
5643f14
Working on making continuations more usable, improving error handling…
hkaiser Jan 28, 2013
554fe10
Fixing a problem in apply_continue
hkaiser Jan 29, 2013
891b040
Removing obsolete comments
hkaiser Jan 29, 2013
db25423
Regenerating all partially preprocessed files to update copyright to …
hkaiser Jan 29, 2013
3845cfa
Blending out files from logging library which are specific to thread …
hkaiser Jan 29, 2013
21dff26
Switching to a different implementation of default implementation for…
hkaiser Jan 29, 2013
4bf6312
Touching up async_continue and apply_continue. Test is in place.
hkaiser Jan 29, 2013
a06831c
Fixing first batch of gcc compilation and linker problems
hkaiser Jan 29, 2013
5c6f0ee
Changing apply_continue to return bool (as apply does)
hkaiser Jan 29, 2013
7632f80
More gcc fixes...
hkaiser Jan 29, 2013
5cd75a9
More re-arrangements to make gcc happy
hkaiser Jan 29, 2013
5c6eea5
Removing superfluous #includes
hkaiser Jan 29, 2013
79d5036
Fix #682: Add performance counters exposing number of stolen threads
hkaiser Jan 29, 2013
6ce300a
Tests: Fixes from Pat.
brycelelbach Jan 29, 2013
a95a173
Fixing some more residual problems
hkaiser Jan 30, 2013
1c4df45
Making MSVC happy
hkaiser Jan 30, 2013
c743296
Fixes #684
Jan 30, 2013
73535c8
Work on hwloc thread pinning
Jan 30, 2013
6a83720
More hwloc thread pinning fixes
sithhell Jan 30, 2013
d562ef2
Fixing problem when a thread should be bound to multiple Cores
sithhell Jan 30, 2013
5dd4246
Merge branch 'dd' of https://github.com/vamatya/hpx into dd
vamatya Jan 30, 2013
d466590
Merge branch 'master' into dd
vamatya Jan 30, 2013
0cf7f72
More hwloc thread pinning fixes
sithhell Jan 30, 2013
97b5c82
Fixing problem when a thread should be bound to multiple Cores
sithhell Jan 30, 2013
4dd5613
Attempt to fix: #686, Linker Error for Applications
hkaiser Jan 31, 2013
182410e
Tweaks to make core affinity work on Windows as well
hkaiser Jan 31, 2013
c70eaae
Fixing new performance counter (stolen threads)
hkaiser Jan 31, 2013
8637c43
Adding fractals example from mailing list.
brycelelbach Jan 31, 2013
e071848
hwloc_topology compilation fix
vamatya Jan 31, 2013
6621205
hwloc_topology compilation error fix
vamatya Jan 31, 2013
92aa342
minor fix
vamatya Jan 31, 2013
3901eb8
merge conflict
vamatya Jan 31, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Expand Up @@ -19,6 +19,7 @@ set(subdirs
dataflow
distributed_test
embarrassingly_parallel
fft
fortran_threadsafe
gtcx
gravity
Expand All @@ -40,8 +41,10 @@ set(subdirs
sheneos
spell_check
startup_shutdown
str_srch
thread_aware_timer
throttle
tictactoe
)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
Expand Down
29 changes: 29 additions & 0 deletions examples/fft/CMakeLists.txt
@@ -0,0 +1,29 @@
# Copyright (c) 2012 Vinay C Amatya
#
# Distributed under the Boost Software License, Version 1.0. (Seec accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

add_definitions(-DHPX_ACTION_ARGUMENT_LIMIT=10)
#add_definitions(-DHPX_COMPONENT_CREATE_ARG_MAX=10)
add_definitions(-DHPX_FUNCTION_LIMIT=13)

# add a custom target for this example
add_hpx_pseudo_target(examples.fft.fft)

add_subdirectory(fft)

# make pseudo-targets depend on master pseudo-target
add_hpx_pseudo_dependencies(examples.fft examples.fft.fft)
#=======================

source_group("Source Files" FILES fft_client.cpp)

# add example executable
add_hpx_executable(fft_client
SOURCES fft_client.cpp
DEPENDENCIES fft_component
FOLDER "Examples/Fft")

# add dependencies to pseudo-target
add_hpx_pseudo_dependencies(examples.fft fft_client_exe)

12 changes: 12 additions & 0 deletions examples/fft/fft/CMakeLists.txt
@@ -0,0 +1,12 @@
# Copyright (c) 2011-2012 Vinay C Amatya

# Distributed under the Boost Software License, Version 1.0. (Seec accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

set(dependencies
distributing_factory_component dataflow_component)

add_hpx_component(fft
DEPENDENCIES ${dependencies}
FOLDER "Examples/Fft"
AUTOGLOB)
47 changes: 47 additions & 0 deletions examples/fft/fft/fft.cpp
@@ -0,0 +1,47 @@

#include <hpx/hpx.hpp>
#include <hpx/include/components.hpp>
#include <hpx/include/serialization.hpp>

#include "server/fft.hpp"

//Add factory registration functionality.
//
HPX_REGISTER_COMPONENT_MODULE();
//////////////////////////////////////////////////////////////////////
typedef hpx::components::simple_component<
fft::server::fourier_xform
> fourier_xform_component_type;

HPX_REGISTER_MINIMAL_COMPONENT_FACTORY(
fourier_xform_component_type, fourier_xform_type);
////////////////////////////////////////////////////////////////////////////////
// Serialization support
HPX_REGISTER_ACTION(
fft::server::fourier_xform::magnitude_from_complex_action
, cc_magnitude_from_complex_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::complex_from_exponential_action
, cc_complex_from_exponential_action);
//HPX_REGISTER_ACTION_EX(
// fft::server::fourier_xform::complex_from_polar_action
// , cc_complex_from_polar_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::complex_mult_action
, cc_complex_mult_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::complex_add_action
, cc_complex_add_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::complex_sub_action
, cc_complex_sub_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::sdft_action
, fourier_xform_sdft_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::r2ditfft_action
, fourier_xform_r2ditfft_action);
HPX_REGISTER_ACTION(
fft::server::fourier_xform::r2ditfft_args_action
, fourier_xform_r2ditfft_args_action);

44 changes: 44 additions & 0 deletions examples/fft/fft/fft.hpp
@@ -0,0 +1,44 @@
#if !defined(HPX_NbzU3Ec9ZIDaLEo3JAF7bh8h5QFTeisEJ8wfO5wh)
#define HPX_NbzU3Ec9ZIDaLEo3JAF7bh8h5QFTeisEJ8wfO5wh
//#include <hpx/hpx_fwd.hpp>
//#include <hpx/lcos/future.hpp>
#include <hpx/include/components.hpp>
//#include <hpx/runtime/components/client_base.hpp>
#include "stubs/fft.hpp"
#include <vector>
namespace fft
{
////////////////////////////////////////////////////////////////////////////
class fourier_xform
: public hpx::components::client_base<
fourier_xform, stubs::fourier_xform
>
{
typedef hpx::components::client_base<
fourier_xform, stubs::fourier_xform
> base_type;
typedef std::vector<fft::complex_type> complex_vector;
public:
fourier_xform()
{}
//fourier_xform(hpx::naming::id_type const& target_gid)
//: base_type(base_type::stub_type::create_sync(target_gid))
//{}

////////////////////////////////////////////////////////////////////////////
//complex_vector sdft(complex_vector const& x)
//double sdft(double x, double y)
//{
//BOOST_ASSERT(this->gid_);
//return this->base_type::sdft(this->gid_, x);
//this->base_type::sdft(this->gid_, x, y);
//}
////////////////////////////////////////////////////////////////////////////
//complex_vector r2ditfft(complex_vector const& x)
//{
//return this->base_type::r2ditfft(this->gid_, x);
//}
////////////////////////////////////////////////////////////////////////////
};
}
#endif
196 changes: 196 additions & 0 deletions examples/fft/fft/fft_distrib.cpp
@@ -0,0 +1,196 @@

#include <hpx/hpx.hpp>
#include <hpx/lcos/future.hpp>
#include <hpx/include/components.hpp>
#include <hpx/include/serialization.hpp>
#include <hpx/components/distributing_factory/server/distributing_factory.hpp>
#include <hpx/util/locality_result.hpp>


#include <fstream>
#include <iostream>
#include <vector>
#include <utility>

#include "./server/fft_d_factory.hpp"
#include "./server/data_split.hpp"
#include "fft_distrib.hpp"

#define default_size 1024

namespace fft
{
fft_distrib::fft_distrib()
{}
fft_distrib::~fft_distrib()
{}

fft_distrib::fft_distrib(std::string const& datafilename
, std::string const& symbolic_name_base, std::size_t const& num_workers
, bool const& use_dataflow)
:datafilename_(datafilename), sn_base_(symbolic_name_base)
, num_workers_(num_workers), use_dataflow_(use_dataflow)
{
//std::cout << "Filename(distrib-obj creation), fft_distrib:" <<
//datafilename_ << std::endl;
}
/////////////////////////////////////////////////////////////////////////////
// create instance of component
void fft_distrib::instantiate()
{
/// component type to be distributed across localities
hpx::components::component_type config_type =
hpx::components::get_component_type<server::distribute>();

hpx::naming::id_type this_prefix = hpx::find_here();

BOOST_ASSERT(num_workers_ != 0);
//std::size_t count = num_workers_;

/// get list of localities that support the given component_type
std::vector<hpx::naming::id_type> localities =
hpx::find_all_localities(config_type);

std::size_t num_localities = localities.size();
fft::server::d_factory::create_components_structured_action
action_type;
/// distribute the number of components
fft_distrib::async_create_result_type results;

results = hpx::async(action_type, this_prefix, config_type, num_workers_);

init(datafilename_, sn_base_, num_workers_, num_localities, results);

//bool component_instantiated = true;
}

void fft_distrib::init(std::string const& datafilename
, std::string const& symbolic_name_base, std::size_t const& num_workers
, std::size_t const& num_localities
, fft_distrib::async_create_result_type& futures)
{

typedef fft::server::distribute::init_config_action
init_action_type;
fft_distrib::result_type results = futures.get();
//fft_distrib::result_type result_idtype;
std::size_t available_locs = results.size();
std::size_t cardinality = 0;

//std::cout << "Filename inside init, fft-distrib:" << datafilename
//<< std::endl;

/// pair< locality, cardinality>
///fft::comp_rank_vec_type comp_rank_pair;

std::vector<hpx::lcos::future<void > > f;

BOOST_FOREACH(locality_result_type& res_t, results)
{
//hpx::lcos::future<void> f;
//localities_.push_back(res_t.prefix_);
BOOST_FOREACH(hpx::naming::id_type& comp_id, res_t.gids_)
{
comp_rank_vec_.push_back(std::make_pair(comp_id, cardinality));
if(cardinality == 0)
loc_zero_comp_id_ = comp_id; //location zero comp_id
++cardinality;
}

}

//comp_rank_ = comp_rank;
BOOST_FOREACH(fft::comp_rank_pair_type& cr, comp_rank_vec_)
{
f.push_back(hpx::async<init_config_action_type>(cr.first,
datafilename, symbolic_name_base, num_workers, num_localities,
cr.first, comp_rank_vec_));
}

//--cardinality;
//BOOST_ASSERT((cardinality - 1) == available_locs);

BOOST_FOREACH(hpx::lcos::future<void> &future_ret, f)
{
future_ret.get();
}
}

fft::comp_rank_vec_type fft_distrib::get_comp_rank_vec()
{
return comp_rank_vec_;
}

void fft_distrib::read_split_data()
{
std::vector<hpx::lcos::future<void> > f;

fft::comp_rank_vec_type comp_rank_vec = fft_distrib::get_comp_rank_vec();
BOOST_FOREACH(fft::comp_rank_pair_type& cr, comp_rank_vec)
{
f.push_back(hpx::async<split_init_action_type>(cr.first));
}

BOOST_FOREACH(hpx::lcos::future<void> &future_ret, f)
{
future_ret.get();
}
}

fft_distrib::complex_vec fft_distrib::transform()
{
typedef fft::server::distribute::dist_transform_action
transform_action_type;
typedef fft::server::distribute::dist_transform_dataflow_action
transform_dataflow_action_type;
typedef fft::server::distribute::get_result_action
get_result_action_type;
typedef fft::server::distribute::dataflow_fetch_remote_action
dflow_fetch_remote_action_type;

fft::comp_rank_vec_type comp_rank_vec = get_comp_rank_vec();

std::vector<hpx::lcos::future<void> > transform_;

if(!use_dataflow_)
{
BOOST_FOREACH(fft::comp_rank_pair_type& cr, comp_rank_vec)
{
transform_.push_back(hpx::async<
transform_action_type>(cr.first));
}
}
else
{
BOOST_FOREACH(fft::comp_rank_pair_type& cr, comp_rank_vec)
{
transform_.push_back(hpx::async<
transform_dataflow_action_type>(cr.first));
}
}

BOOST_FOREACH(hpx::lcos::future<void>& txfm, transform_)
{
txfm.get();
}

hpx::lcos::future<fft::fft_distrib::complex_vec> final_result;

if(!use_dataflow_)
{
final_result =
hpx::async<get_result_action_type>(get_local_comp_id());
}
else
{
final_result =
hpx::async<dflow_fetch_remote_action_type>(get_local_comp_id());
}
return final_result.get();
}

hpx::naming::id_type fft_distrib::get_local_comp_id()
{
return loc_zero_comp_id_;
}
}