inline bool apply_r_p(std::vector<naming::address>& addrs, std::vector<naming::gid_type> const& gids, threads::thread_priority priority) { typedef typename hpx::actions::extract_action<Action>::type action_type; // sort destinations std::map<naming::locality, destinations> dests; std::size_t count = gids.size(); for (std::size_t i = 0; i < count; ++i) { complement_addr<action_type>(addrs[i]); destinations& dest = dests[addrs[i].locality_]; dest.gids_.push_back(gids[i]); dest.addrs_.push_back(addrs[i]); } // send one parcel to each of the destination localities parcelset::parcelhandler& ph = hpx::applier::get_applier().get_parcel_handler(); actions::action_type act( new hpx::actions::transfer_action<action_type>(priority)); std::for_each(dests.begin(), dests.end(), send_parcel(ph, act)); return false; // destination is remote }
int do_password(unsigned char *name, unsigned char *password, int is_console) { #ifdef NO_X11 show_password(name, password); return 1; #endif if (is_console) { show_password(name, password); return 1; } struct parcel pc; pc.type = PT_COPY; pc.length = strlen(password) + 1; // capture zero byte pc.data = (void *) password; if (!send_parcel(&pc)) { show_password(name, password); return 1; } printf("Password for %s was copied to the buffer\n", name); return 1; }
result_type operator()() { return send_parcel(util::forward_as_tuple()); }