open sch
namespace alps { namespace scheduler { class Factory { public: virtual Task* make_task(const ProcessList& where ,const boost::filesystem::path& file) const=0; virtual Worker* make_worker(const osiris::ProcessList& where,const palm::Parameters& parms,int node) const=0; }; template <class WORKER, class TASK=Task> class SimpleFactory : public Factory { public: virtual Task* make_task(const ProcessList& where ,const boost::filesystem::path& file) const; virtual Worker* make_worker(const osiris::ProcessList& where,const palm::Parameters& parms,int node) const; }; int start(int argc, char** argv ,const Factory&); } }
The SimpleFactory template can be used for factories that just create a single type of simulation, which might be the most common case. They expect a constructor with the same signature as the function.
creates a new user object derived from Worker on the nodes given by the argument where and with the parameters given by parms. The last argument node will be used in a future release to support multi-node workers spread over more than one node. The argument (which is alway 0 at the moment) will be the index into the ProcessList for which the object should be constructed. The parameters object parms can be used to distinguish bewteen different types of simulations in a program that does more than one type of simulations.virtual Worker* make_worker(const osiris::ProcessList& where,const palm::Parameters& parms,int node) const;
runs the simulation(s). argc and argv are the parameters passed to program by the operating system (see the section about running a simulation). The user_factory object will be used to create and load the Worker objects of the simulations. It should be an object of a class derived from Factory.int start(int argc, char** argv, const Factory& user_factory);
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)