(
void);
55 virtual int Run(
void);
64 return "SampleNodeClient version 1.0.1";
80arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
81 "Grid client sample");
83arg_desc->AddOptionalKey(
"vsize",
85 "Size of the test vector",
88arg_desc->AddOptionalKey(
"jobs",
90 "Number of jobs to submit",
93arg_desc->AddFlag(
"pm",
94 "Use Progress Messages");
106 if(args[
"vsize"]) {
107vsize = args[
"vsize"].AsInteger();
109 intjobs_number = 10;
110 if(args[
"jobs"]) {
111jobs_number = args[
"jobs"].AsInteger();
118vector<string> job_keys;
120cout <<
"Submit a job..."<< jobs_number << endl;
122 for(
int i= 0;
i< jobs_number; ++
i) {
132srand( (
unsigned)time(
NULL) );
133 for(
intj = 0; j < vsize; ++j) {
134 doubled = rand()*0.2;
138job_keys.push_back(grid_client.
Submit());
140cout << endl <<
"Done."<< endl;
142cout <<
"Waiting for job "<< job_keys.size() <<
"..."<< endl;
144 unsigned int cnt= 0;
148vector<string> done_jobs;
149 for(
autoit = job_keys.begin(); it != job_keys.end(); ++it) {
164vector<double> resvec;
165 for(
int i= 0;
i<
count; ++
i) {
175done_jobs.push_back(*it);
182done_jobs.push_back(*it);
189done_jobs.push_back(*it);
193 for(
const auto& job : done_jobs) {
194job_keys.erase(
remove(job_keys.begin(),job_keys.end(), job),job_keys.end());
196 if(job_keys.empty())
200 if(++
cnt% 1000 == 0) {
201cout <<
"Still waiting..."<< endl;
virtual bool UseProgressMessage() const
virtual void Init(void)
If you override this method, do call CGridClientApp::Init() from inside your overriding method.
virtual int Run(void)
Run the application.
virtual string GetProgramVersion(void) const
Get program version (like: MyProgram v.
Grid Client (the submitter).
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
NetSchedule Framework specs.
NetSchedule Framework specs.
int NcbiSys_main(int argc, ncbi::TXChar *argv[])
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ eInteger
Convertible into an integer number (int or Int8)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Warning(CExceptionArgs_Base &args)
void Info(CExceptionArgs_Base &args)
EJobStatus
Job status codes.
void SetJobKey(const string &job_key)
const string & GetErrorMessage()
If something bad has happened this method will return an explanation.
virtual void Init(void)
If you override this method, do call CGridClientApp::Init() from inside your overriding method.
CNetScheduleAPI::EJobStatus GetStatus()
Get a job status.
CNcbiIstream & GetIStream()
Get a stream with a job's result.
string Submit(const string &affinity=kEmptyStr)
Submit a job to the queue.
CNcbiOstream & GetOStream()
Get a stream where a client can write an input data for the remote job.
CGridClient & GetGridClient()
Get a grid client.
@ eDone
Job is ready (computed successfully)
@ eCanceled
Explicitly canceled.
@ eFailed
Failed to run (execution timeout)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
where both of them are integers Note
void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Miscellaneous common-use basic types and functionality.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4