Hi Chris, I hope I'll be able to answer your questions inline below...
On Dienstag, 25. April 2017 14:30:36 CEST ct clmsn wrote: > thomas, > > i'm in the midst of building a customized type to load histogram > information from files into a partitioned_vector. ideally, an hpx parallel > loop (for_each) should run over the partitioned_vector's elements in order > to schedule execution of an hpx-action which tells the partitioned_vector's > elements to load their respective data files (the parallel loop is a vector > of file paths). Alright ... in that case, I'd suggest to write an application which combines hpx::partitioned_vector and hpx::unordered_map (https://github.com/STEllAR-GROUP/hpx/blob/master/hpx/components/containers/unordered/ unordered_map.hpp#L222). Depending on how you get the list of files, you can create a partitioned_vector with a specific size, then use for_each to get the entries. The User-defined element function will then be executed exactly where the specific element resides. In this function (which needs to be serializable), you can then load your file and create the histogram updating the distributed unordered hash map with the file content (in parallel). > > which parts of the hpx source tree (unit tests, examples) would you > encourage me to review? i get the impression this should be a fairly > straightforward bit of code. The unit tests are always a good reference ... however not very condensed to get the message across: https://github.com/STEllAR-GROUP/hpx/blob/master/tests/unit/component/ partitioned_vector_for_each.cpp https://github.com/STEllAR-GROUP/hpx/blob/master/tests/unit/component/ unordered_map.cpp There are also some examples featuring the distributed data structures: https://github.com/STEllAR-GROUP/hpx/blob/master/examples/quickstart/ partitioned_vector_spmd_foreach.cpp If you need to synchronize in between partitions, I suggest to use channel objects, featured here: https://github.com/STEllAR-GROUP/hpx/blob/master/examples/quickstart/ local_channel.cpp The same exists in a distributed manner, which is probably best explained here: https://stellar-group.github.io/tutorials/hlrs2017/session5/#30 I hope that helps a bit... I know that our documentation needs major work... so best is to just ask here where to find the stuff you are looking for. > > thanks in advance, > > ct > > On Mon, Apr 24, 2017 at 4:52 PM, Thomas Heller <[email protected]> > > wrote: > > Hi Chris, > > > > Am 24.04.2017 7:30 nachm. schrieb "ct clmsn" <[email protected]>: > > > > two questions for the stellar community - if i'm writing a distributed > > program that does not use the hpx spmd model, does hpx require the > > partitioned_vector storing components to be registered into the agas? if > > so, does hpx also require a call the connect function? several of the > > non-spmd partitioned_vector unit tests do not require register/connect - > > were those unit tests intended only to support single-node testing or is > > distributed execution also supported? > > > > > > I'm going to answer that later... Requires more writing... > > > > > > on a separate issue, i'd like to access the contents of a distributed > > vector that stores a component called 'dataset_t' (the component inherits > > from hpx::components::simple_component_base<dataset_t> ; the client > > interface for the component inherits from > > hpx::components::client_base<dataset_t, server::dataset_t>). > > > > > > Just for future reference, this might not be what you want. For > > hpx::partitioned_vector<T>, T does not need to be a component. In fact, > > the > > vector stores any T and distributes it over the partitions. > > > > > > currently, the following code compiles and produces a runtime exception. > > > > std::vector<std::size_t> pos = { static_cast<std::size_t>(idx) }; > > std::vector<dataset_t> svec = dataset_arr.get_values_sync(pos); > > > > hpx::future<void> fc = svec[0].create(args); > > fc.wait(); > > hpx::future<void> fv = dataset_arr.set_values(pos, svec); > > fv.wait(); > > > > the program runs on 1 node/host without any runtime arguments applied. the > > runtime exception reads: > > > > "{what}: this client_base has no valid shared state: HPX(no_state)" > > > > > > Makes sense, the client is default constructed, which doesn't create a > > component. It might not need to after all (see comment above). > > > > > > how should i comprehend this runtime exception? > > > > > > The client did not allocate a component which it "points" to. > > > > All in all it's difficult to say what the proper fix would be without > > looking at the code. > > > > > > also, when the following, much simpler implementation, of sample code > > runs: > > > > hpx::future<dataset_t> fd = dataset_arr.get_value(static_c > > ast<std::size_t>(idx)); > > fd.wait(); > > > > i had the following compile error: > > > > "hpx/traits/get_remote_result.hpp:25:41: error: no matching function for > > call to 'hpx::naming::id_type::id_type(std::remove_reference<dataset > > _t&>::type" > > > > > > any help, questions, or assistance would be appreciated! > > > > chris > > > > _______________________________________________ > > hpx-users mailing list > > [email protected] > > https://mail.cct.lsu.edu/mailman/listinfo/hpx-users > > > > > > > > _______________________________________________ > > hpx-users mailing list > > [email protected] > > https://mail.cct.lsu.edu/mailman/listinfo/hpx-users _______________________________________________ hpx-users mailing list [email protected] https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
