(
void);
56 virtual int Run(
void);
71arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
74arg_desc->AddPositional(
"service",
75 "NetSchedule service name",
77arg_desc->AddPositional(
"queue",
78 "NetSchedule queue name (like: noname).",
89 const string& service = args[
"service"].AsString();
90 const string& queue_name = args[
"queue"].AsString();
95 intno_jobs_counter = 0;
96 unsignedjobs_done = 0;
99 boolfirst_try =
true;
126job_exists = executor.
GetJob(job, 560);
129cout <<
"\nProcessing."<< endl;
130node_status = 0; first_try =
false;
132 if(node_status != 0) {
133cout <<
"\nProcessing."<< endl;
137 stringexpected_input =
"Hello "+ queue_name;
138 if(expected_input != job.
input) {
142 if(jobs_processed.
find(job.
job_id) != jobs_processed.
end()) {
144<<
" has already been processed.");
151job.
output=
"DONE "+ queue_name;
157 if(jobs_done % 50 == 0) {
158cout <<
"*"<< flush;
163cout <<
"\nWaiting."<< endl;
164node_status = 1; first_try =
false;
166 if(node_status != 1) {
167cout <<
"\nWaiting."<< endl;
170 if(++no_jobs_counter > 7) {
171cout <<
"\nNo new jobs arriving. Processing closed."<< endl;
177cout << endl <<
"Jobs done: "<< jobs_processed.
size() << endl;
Client API for NCBI NetSchedule server.
Smart pointer to a part of the NetSchedule API that does job retrieval and processing on the worker n...
virtual int Run(void)
Run the application.
virtual void Init(void)
Initialize the application.
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
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.
@ eString
An arbitrary string.
void SetDiagPostFlag(EDiagPostFlag flag)
Set the specified flag (globally).
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
@ eDPF_Trace
Default flags to use when tracing.
@ eDiag_Info
Informational message.
string output
Job result data.
void PutResult(const CNetScheduleJob &job)
Put job result (job should be received by GetJob() or WaitJob())
bool GetJob(CNetScheduleJob &job, const string &affinity_list=kEmptyStr, CDeadline *dealine=NULL)
Get a pending job.
CNetScheduleExecutor GetExecutor()
Create an instance of CNetScheduleExecutor.
string job_id
Output job key.
void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
Miscellaneous common-use basic types and functionality.
Process information in the NCBI Registry, including working with configuration files.
NetSchedule client specs.
int NcbiSys_main(int argc, ncbi::TXChar *argv[])
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