namespace alps { class Host : public Dumpable { public: Host(); Host(int32_t id, const std::string& name="", double speed=1.0); bool operator==(const Host& h) const; bool operator!=(const Host& h) const; bool valid() const; const std::string& name() const; operator int32_t () const; double speed() const; }; class Process : public Host { public: Process(); Process(const Host&, const int); Process(const int); bool valid() const; bool on_host(const Host& h) const; bool local() const; operator uint32_t (); bool operator==(const alps::Process& p); bool operator!=(const alps::Process& p); bool operator<(const alps::Process& p); }; typedef std::vector<Host> HostList; typedef std::vector<Process> ProcessList; std::ostream& operator << (std::ostream&, const Host&); std::ostream& operator << (std::ostream&, const Process&); ODump& operator << (ODump&, const Host&); ODump& operator << (ODump&, const Process&); IDump& operator >> (IDump&, Host&); IDump& operator >> (IDump&, Process&); }
creates a Host object referring to no machine. The member function valid will return false.Host();
creates a Host object referring to the machine with given ID number, and optional name and relative speed. The relative speed can be used by load balancing algorithms.Host(int32_t id, const std::string& name="", double speed=1.0);
Serialization and deserialization.void save(ODump&) const; void load(IDump&);
comparison operators for host machines.bool operator==(const Host& h) const; bool operator!=(const Host& h) const;
checks if the object refers to a valid and running machine.bool valid() const;
the name of the machine.const std::string& name() const;
The ID of the host machine.operator int32_t () const;
The relative speed of the machine.double speed() const;
creates a Process object referring to no process. The member function valid will return false.Process();
creates a Process object for the process with given process id on a given Host.Process(const Host&, const int pid);
creates a Process object for the process with given process id on an unknown host.Process(const int);
Serialization and deserialization.void save(ODump&) const; void load(IDump&);
checks if the process referred to by the object is valid and running.bool valid() const;
checks if the process runs on the given host machine.bool on_host(const Host& h) const;
checks if the process runs on the local machine.bool local() const;
the process id.operator uint32_t ();
Comparison operators. Process objects are sorted by process id.bool operator==(const alps::Process& p); bool operator!=(const alps::Process& p); bool operator<(const alps::Process& p);
useful type definitions for vectors of Host and Process objects.typedef std::vector<Host> HostList; typedef std::vector<Process> ProcessList;
writes information about the host and process to a std::ostream.std::ostream& operator << (std::ostream&, const alps::Host&); std::ostream& operator << (std::ostream&, const alps::Process&);
serialize and deserialize the objects.ODump& operator << (ODump&, const Host&); ODump& operator << (ODump&, const Process&); IDump& operator >> (IDump&, Host&); IDump& operator >> (IDump&, Process&);
copyright (c) 1994-2010 by Matthias Troyer
Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)