A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/grid__client__sample_8cpp_source.html below:

NCBI C++ ToolKit: src/sample/app/netschedule/grid_client_sample.cpp Source File

54  virtual void Init

(

void

);

55  virtual int Run

(

void

);

64  return "SampleNodeClient version 1.0.1"

;

80

arg_desc->SetUsageContext(

GetArguments

().GetProgramBasename(),

81  "Grid client sample"

);

83

arg_desc->AddOptionalKey(

"vsize"

,

85  "Size of the test vector"

,

88

arg_desc->AddOptionalKey(

"jobs"

,

90  "Number of jobs to submit"

,

93

arg_desc->AddFlag(

"pm"

,

94  "Use Progress Messages"

);

106  if

(args[

"vsize"

]) {

107

vsize = args[

"vsize"

].AsInteger();

109  int

jobs_number = 10;

110  if

(args[

"jobs"

]) {

111

jobs_number = args[

"jobs"

].AsInteger();

118

vector<string> job_keys;

120

cout <<

"Submit a job..."

<< jobs_number << endl;

122  for

(

int i

= 0;

i

< jobs_number; ++

i

) {

132

srand( (

unsigned

)time(

NULL

) );

133  for

(

int

j = 0; j < vsize; ++j) {

134  double

d = rand()*0.2;

138

job_keys.push_back(grid_client.

Submit

());

140

cout << endl <<

"Done."

<< endl;

142

cout <<

"Waiting for job "

<< job_keys.size() <<

"..."

<< endl;

144  unsigned int cnt

= 0;

148

vector<string> done_jobs;

149  for

(

auto

it = job_keys.begin(); it != job_keys.end(); ++it) {

164

vector<double> resvec;

165  for

(

int i

= 0;

i

<

count

; ++

i

) {

175

done_jobs.push_back(*it);

182

done_jobs.push_back(*it);

189

done_jobs.push_back(*it);

193  for

(

const auto

& job : done_jobs) {

194

job_keys.erase(

remove

(job_keys.begin(),job_keys.end(), job),job_keys.end());

196  if

(job_keys.empty())

200  if

(++

cnt

% 1000 == 0) {

201

cout <<

"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