00001 // @(#) root/glite:$Id: TGLite.cxx 31993 2010-01-12 14:34:41Z rdm $ 00002 // Author: Anar Manafov <A.Manafov@gsi.de> 2006-03-20 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 /************************************************************************/ 00013 /*! \file TGLite.cxx 00014 Implementation of the class which 00015 defines interface to gLite GRID services. */ /* 00016 00017 version number: $LastChangedRevision: 1688 $ 00018 created by: Anar Manafov 00019 2006-03-20 00020 last changed by: $LastChangedBy: manafov $ $LastChangedDate: 2008-01-23 13:42:32 +0100 (Wed, 23 Jan 2008) $ 00021 00022 Copyright (c) 2006-2008 GSI GridTeam. All rights reserved. 00023 *************************************************************************/ 00024 00025 //*-- Last Update : $LastChangedDate: 2008-01-23 13:42:32 +0100 (Wed, 23 Jan 2008) $ by $LastChangedBy: manafov $ 00026 //*-- Author : Anar Manafov (A.Manafov@gsi.de) 2006-03-20 00027 //*-- Copyright: Copyright (c) 2006-2008 GSI GridTeam. All rights reserved. 00028 00029 // glite-api-wrapper 00030 #include <glite-api-wrapper/gLiteAPIWrapper.h> 00031 // ROOT 00032 #include "TMap.h" 00033 #include "TObjString.h" 00034 // ROOT RGLite 00035 #include "TGLiteResult.h" 00036 #include "TGLiteJob.h" 00037 #include "TGLite.h" 00038 00039 //////////////////////////////////////////////////////////////////////////////// 00040 /* BEGIN_HTML 00041 The TGLite class defines an interface to <A href="http://glite.web.cern.ch/glite/" name="gLite GRID services">gLite GRID services</A>. This class is a part of RGlite plug-in developed at <A href="http://www.gsi.de" name="GSI, Darmstadt">GSI, Darmstadt</A>.<br> 00042 The RGLite plug-in uses <A href="https://subversion.gsi.de/trac/dgrid/wiki">glite-api-wrapper library (GAW)</A> to perform Grid operations and provides the following features: 00043 <ul> 00044 <li>Workload Management System operations: 00045 <ul> 00046 <li>job submission - normal, DAG and parametric jobs (gLite WMProxy API),</li> 00047 <li>smart look-up algorithm for WMP-Endpoints,</li> 00048 <li>job status querying (gLite LB API),</li> 00049 <li>job output retrieving (Globus GridFTP).</li> 00050 </ul> 00051 </li> 00052 <li>File Catalog operations (gLite/LCG LFC API): 00053 <ul> 00054 <li>smart session manager,</li> 00055 <li>set/query the current working catalog directory,</li> 00056 <li>list files, directories and their stats,</li> 00057 <li>add/remove files in a catalog namespace,</li> 00058 <li>add/remove directories,</li> 00059 <li>add/remove replicas from a given file.</li> 00060 </ul> 00061 </li> 00062 <li>An executive logging.</li> 00063 <li>Support of an external xml configuration file with according XML schema.</li> 00064 </ul> 00065 00066 <h3>Content</h3> 00067 <ol style="list-style-type: upper-roman;"> 00068 <li><a href="#requirements">Requirements</a></li> 00069 <li><a href="#conf">Configuration</a></li> 00070 <li><a href="#usage">Usage</a> 00071 <ol> 00072 <li><a href="#usage:job_opt">Job operations</a></li> 00073 <li><a href="#usage:file_catalog_opt">File Catalog operations</a></li> 00074 </ol> 00075 </li> 00076 </ol> 00077 <br> 00078 00079 <h3><a name="requirements">Requirements</a></h3> 00080 <ol> 00081 <li><A href="http://glite.web.cern.ch/glite/packages/userInterface.asp">gLite UI 3.1</A></li> 00082 <li><A href="https://subversion.gsi.de/trac/dgrid/wiki">glite-api-wrapper library</A></li> 00083 <li>A Grid proxy (in order to perform gLite operations RGLite requires a Grid proxy, users therefore should create the Grid proxy before using the plug-in. One can create the Grid proxy with help of <em>voms-proxy-init</em> command, for example)</li> 00084 </ol> 00085 00086 <h3><a name="conf">Configuration</a></h3> 00087 Since RGLite plug-in is based on <A href="https://subversion.gsi.de/trac/dgrid/wiki">glite-api-wrapper library</A> one should use GAW configuration file for tuning RGLite options up. Please refer to <A href="https://subversion.gsi.de/trac/dgrid/wiki">a GAW Trac</A> for more information. 00088 00089 <h3><a name="usage">Usage</a></h3> 00090 Be advised that the call of <em>TGrid::Connect("glite")</em> should be the very first one. It initializes RGLite plug-in and assigns a global variable <em>gGrid</em> with a pointer to the RGLite plug-in object. The plug-in on his side will initialize a GAW singleton and the <em>TGrid::Connect("glite")</em> call therefore can be performed only once. If you successfully "connected" to gLite, you can call other methods of TGrid interface. Please see the following examples. 00091 <h4><a name="usage:job_opt">Job operations</a></h4> 00092 <table width="100%" border="0"> 00093 <tbody bgcolor="#ffdca8"> 00094 <tr> 00095 <td> 00096 <font color="Green">// loading RGLite plug-in</font><br> 00097 TGrid::Connect("glite");<br> 00098 <font color="Green">// submitting Grid job</font><br> 00099 TGridJob *job = gGrid->Submit("JDLs/simple.jdl");<br> 00100 <font color="Green">// getting status object</font><br> 00101 TGridJobStatus *status = job->GetJobStatus();<br> 00102 <font color="Green">// getting status of the job.</font><br> 00103 TGridJobStatus::EGridJobStatus st( status->GetStatus() );<br> 00104 <font color="Green">// when the st is TGridJobStatus::kDONE you can retrieve job's output</font><br> 00105 job->GetOutputSandbox("/tmp");<br> 00106 </td> 00107 </tr> 00108 </tbody> 00109 </table> 00110 <h4><a name="usage:file_catalog_opt">File Catalog operations</a></h4> 00111 <h5>Cd, Pwd, Ls</h5> 00112 <table width="100%"> 00113 <tbody bgcolor="#ffdca8"> 00114 <tr> 00115 <td> 00116 <font color="Green">// loading RGLite plug-in</font><br> 00117 TGrid::Connect("glite");<br> 00118 <font color="Green">// current Catalog directory</font><br> 00119 cout << "Working Directory is " << gGrid->Pwd() << endl; 00120 <br> 00121 <font color="Green">// listing the current directory</font><br> 00122 TGridResult* result = gGrid->Ls();<br> 00123 result->Print("all");<br> 00124 <font color="Green">// changing the current directory to "dech"</font><br> 00125 gGrid->Cd("dech");<br> 00126 <font color="Green">// listing only file names</font><br> 00127 TGridResult * res = gGrid->Ls();<br> 00128 Int_t i = 0;<br> 00129 while ( res->GetFileName( i ) ) 00130 <br> 00131 cout << "File: " << res->GetFileName( i++ ) << endl; 00132 <br> 00133 </td> 00134 </tr> 00135 </tbody> 00136 </table> 00137 00138 <h5>Mkdir, Rmdir</h5> 00139 00140 <table width="100%"> 00141 <tbody bgcolor="#ffdca8"> 00142 <tr> 00143 <td> 00144 <font color="Green">// loading RGLite plug-in</font><br> 00145 TGrid::Connect("glite");<br> 00146 <font color="Green">// changing the current directory to "/grid/dech"</font><br> 00147 gGrid->Cd("/grid/dech");<br> 00148 <font color="Green">// using Mkdir to create a new directory</font><br> 00149 Bool_t b = gGrid->Mkdir("root_test2");<br> 00150 <font color="Green">// listing the current directory</font><br> 00151 TGridResult* result = gGrid->Ls();<br> 00152 <font color="Green">// full file information</font><br> 00153 result->Print("all");<br> 00154 <font color="Green">// removing the directory </font><br> 00155 b = gGrid->Rmdir("root_test2");<br> 00156 </td> 00157 </tr> 00158 </tbody> 00159 </table> 00160 END_HTML */ 00161 //////////////////////////////////////////////////////////////////////////////// 00162 00163 ClassImp(TGLite) 00164 00165 using namespace std; 00166 using namespace glite_api_wrapper; 00167 using namespace LFCHelper; 00168 using namespace MiscCommon; 00169 00170 template<class _T> 00171 void add_map_element(TMap *_map, const string &_key, const _T &_value) 00172 { 00173 ostringstream ss; 00174 ss << _value; 00175 TObjString * key(new TObjString(_key.c_str())); 00176 TObjString *value(new TObjString(ss.str().c_str())); 00177 _map->Add(dynamic_cast<TObject*>(key), dynamic_cast<TObject*>(value)); 00178 } 00179 00180 struct SAddRepInfo: public binary_function<SLFCRepInfo_t, TMap*, bool> { 00181 bool operator()(first_argument_type _rep, second_argument_type m_Map) const { 00182 ostringstream strSFN; 00183 strSFN << "sfn" << _rep.id; 00184 stringstream strHost; 00185 strHost << "host" << _rep.id; 00186 add_map_element(m_Map, strSFN.str(), _rep.sfn); 00187 add_map_element(m_Map, strHost.str(), _rep.host); 00188 return true; 00189 } 00190 }; 00191 00192 struct SAddMapElementFunc: public binary_function<SLFCFileInfo_t, TGLiteResult*, bool> { 00193 bool operator()(first_argument_type _lfc_info, second_argument_type _Result) const { 00194 TMap * map = new TMap(); 00195 00196 add_map_element(map, "fileid", _lfc_info.m_nFileID); 00197 add_map_element(map, "name", _lfc_info.m_sName); 00198 add_map_element(map, "size", _lfc_info.m_nSize); 00199 add_map_element(map, "guid", _lfc_info. m_sGUID); 00200 add_map_element(map, "rep_count", _lfc_info.m_LFCRepInfoVector.size()); 00201 00202 // Add replication info 00203 for_each(_lfc_info.m_LFCRepInfoVector.begin(), 00204 _lfc_info.m_LFCRepInfoVector.end(), 00205 bind2nd(SAddRepInfo(), map)); 00206 00207 _Result->Add(map); 00208 return true; 00209 } 00210 }; 00211 00212 //______________________________________________________________________________ 00213 TGLite::TGLite(const char */*_gridurl*/, const char* /*uid*/, const char* /*passwd*/, const char* /*options*/) 00214 { 00215 // Initializing the RGLite plug-in and making a connection to gLite UI. 00216 // INPUT: 00217 // _gridurl [in] - must be a "glite" string. 00218 // NOTE: 00219 // The other parameters are unsupported. 00220 00221 if (!CGLiteAPIWrapper::Instance().Init()) { 00222 gGrid = this; 00223 fPort = 0; // Will be used in TGLite::IsConnected 00224 Info("TGLite", "gLite API Wrapper engine has been successfully initialized."); 00225 } else { 00226 // failed to connect to gLite 00227 fPort = -1; 00228 } 00229 } 00230 00231 00232 //______________________________________________________________________________ 00233 TGLite::~TGLite() 00234 { 00235 // Destructor 00236 } 00237 00238 00239 //______________________________________________________________________________ 00240 Bool_t TGLite::IsConnected() const 00241 { 00242 // Use this method to find out whether the RGLite plug-in is connected to gLite UI or not. 00243 // RETURN: 00244 // kTRUE if connected and kFALSE otherwise. 00245 00246 return (-1 == fPort ? kFALSE : kTRUE); 00247 } 00248 00249 00250 //______________________________________________________________________________ 00251 void TGLite::Shell() 00252 { 00253 // Not implemented for RGLite 00254 00255 MayNotUse("Shell"); 00256 } 00257 00258 00259 //______________________________________________________________________________ 00260 void TGLite::Stdout() 00261 { 00262 // Not implemented for RGLite 00263 00264 MayNotUse("Stdout"); 00265 } 00266 00267 00268 //______________________________________________________________________________ 00269 void TGLite::Stderr() 00270 { 00271 // Not implemented for RGLite 00272 00273 MayNotUse("Stderr"); 00274 } 00275 00276 00277 //______________________________________________________________________________ 00278 TGridResult* TGLite::Command(const char* /*command*/, Bool_t /*interactive*/, UInt_t /*stream*/) 00279 { 00280 // Not implemented for RGLite 00281 00282 MayNotUse("Command"); 00283 return NULL; 00284 } 00285 00286 00287 //______________________________________________________________________________ 00288 TGridResult* TGLite::Query(const char *_path, const char *_pattern /*= NULL*/, const char* /*conditions*/, const char* /*options*/) 00289 { 00290 // A File Catalog method. Querying a File Catalog. 00291 // INPUT: 00292 // _path [in] - a File Catalog directory which query will be executed on. 00293 // _pattern [in] - a POSIX regular expression pattern. 00294 // If a NULL value provided the default pattern will be used, 00295 // which is ".*" - match any. 00296 // NOTE: 00297 // The third and the forth parameters are unsupported. 00298 // RETURN: 00299 // A TGridResult object, which holds the result of the query. 00300 00301 if (!_path) 00302 return NULL; // TODO: msg me! 00303 00304 // Call for a Catalog manager 00305 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00306 if (!pCatalog) 00307 return NULL; // TODO: Log me! 00308 00309 LFCFileInfoVector_t container; 00310 gaw_lfc_ls ls; 00311 ls.m_dir = _path; 00312 if (_pattern) 00313 ls.m_pattern = _pattern; 00314 try { 00315 pCatalog->Run(ls, &container); 00316 } catch (const exception &e) { 00317 Error("Query", "Exception: %s", e.what()); 00318 return NULL; 00319 } 00320 00321 // Creating ROOT containers to store the resultset 00322 TGLiteResult *result = new TGLiteResult(); 00323 for_each(container.begin(), container.end(), bind2nd(SAddMapElementFunc(), result)); 00324 00325 return result; 00326 } 00327 00328 00329 //______________________________________________________________________________ 00330 TGridResult* TGLite::LocateSites() 00331 { 00332 // Not implemented for RGLite 00333 00334 MayNotUse("LocalSites"); 00335 return NULL; 00336 } 00337 00338 //______________________________________________________________________________ 00339 //--- Catalog Interface 00340 TGridResult* TGLite::Ls(const char *_ldn, Option_t* /*options*/, Bool_t /*verbose*/) 00341 { 00342 // A File Catalog method. Listing content of the current working directory. 00343 // INPUT: 00344 // _ldn [in] - a logical name of the directory to list. 00345 // NOTE: 00346 // The other parameters are unsupported. 00347 // RETURN: 00348 // A TGridResult object, which holds the result of the listing. 00349 // The method returns NULL in case of if an error occurred. 00350 00351 if (!_ldn) 00352 return NULL; // TODO: report error 00353 00354 // Call for a Catalog manager 00355 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00356 if (!pCatalog) 00357 return NULL; // TODO: Log me! 00358 00359 LFCFileInfoVector_t container; 00360 gaw_lfc_ls ls; 00361 ls.m_dir = _ldn; 00362 try { 00363 pCatalog->Run(ls, &container); 00364 } catch (const exception &e) { 00365 Error("Ls", "Exception: %s", e.what()); 00366 return NULL; 00367 } 00368 00369 // Creating a ROOT container to store the resultset 00370 TGLiteResult *result = new TGLiteResult(); 00371 for_each(container.begin(), container.end(), bind2nd(SAddMapElementFunc(), result)); 00372 00373 return result; 00374 } 00375 00376 00377 //______________________________________________________________________________ 00378 const char* TGLite::Pwd(Bool_t /*verbose*/) 00379 { 00380 // A File Catalog method. Retrieving a name of the current working directory. 00381 // NOTE: 00382 // The parameter is unsupported. 00383 // RETURN: 00384 // a logical name of the new current working directory. 00385 00386 00387 // Call for a Catalog manager 00388 CCatalogManager *pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00389 if (!pCatalog) 00390 return NULL; // TODO: Log me! 00391 00392 gaw_lfc_pwd pwd; 00393 try { 00394 pCatalog->Run(pwd, &fFileCatalog_WrkDir); 00395 } catch (const exception &e) { 00396 Error("Pwd", "Exception: %s", e.what()); 00397 return NULL; 00398 } 00399 00400 return fFileCatalog_WrkDir.c_str(); 00401 } 00402 00403 00404 //______________________________________________________________________________ 00405 Bool_t TGLite::Cd(const char *_ldn, Bool_t /*verbose*/) 00406 { 00407 // A File Catalog method. Changing the current working directory. 00408 // INPUT: 00409 // _ldn [in] - a logical name of the destination directory 00410 // NOTE: 00411 // The other parameter is unsupported. 00412 // RETURN: 00413 // kTRUE if succeeded and kFALSE otherwise. 00414 00415 00416 if (!_ldn) 00417 return kFALSE; 00418 00419 // Call for a Catalog manager 00420 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00421 if (!pCatalog) 00422 return kFALSE; // TODO: Log me! 00423 00424 gaw_lfc_cwd cwd; 00425 cwd.m_dir = _ldn; 00426 try { 00427 pCatalog->Run(cwd); 00428 } catch (const exception &e) { 00429 Error("Cd", "Exception: %s", e.what()); 00430 return kFALSE; 00431 } 00432 00433 return kTRUE; 00434 } 00435 00436 00437 //______________________________________________________________________________ 00438 Int_t TGLite::Mkdir(const char *_ldn, Option_t* /*options*/, Bool_t /*verbose*/) 00439 { 00440 // A File Catalog method. Create a new directory on the name server. 00441 // INPUT: 00442 // _ldn [in] - a logical name of the directory to create. 00443 // NOTE: 00444 // The other parameters are unsupported. 00445 // RETURN: 00446 // kTRUE if succeeded and kFALSE otherwise. 00447 00448 if (!_ldn) 00449 return kFALSE; 00450 00451 // Call for a Catalog manager 00452 // TODO: implement *options* in order to use mkdir with "mode" and "guid" 00453 CCatalogManager *pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00454 if (!pCatalog) 00455 return kFALSE; // TODO: Log me! 00456 00457 gaw_lfc_mkdir mkdir; 00458 mkdir.m_dir = _ldn; 00459 try { 00460 pCatalog->Run(mkdir); 00461 } catch (const exception &e) { 00462 Error("Mkdir", "Exception: %s", e.what()); 00463 return kFALSE; 00464 } 00465 00466 return kTRUE; 00467 } 00468 00469 00470 //______________________________________________________________________________ 00471 Bool_t TGLite::Rmdir(const char *_ldn, Option_t* /*options*/, Bool_t /*verbose*/) 00472 { 00473 // A File Catalog method, it removes a directory from the name server if it is an empty one. 00474 // INPUT: 00475 // _ldn [in] - a logical name of the directory to remove. 00476 // NOTE: 00477 // The other parameters are unsupported. 00478 // RETURN: 00479 // kTRUE if succeeded and kFALSE otherwise. 00480 00481 if (!_ldn) 00482 return kFALSE; 00483 00484 // Call for a Catalog manager 00485 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00486 if (!pCatalog) 00487 return kFALSE; // TODO: Log me! 00488 00489 gaw_lfc_rmdir rmdir; 00490 rmdir.m_dir = _ldn; 00491 try { 00492 pCatalog->Run(rmdir); 00493 } catch (const exception &e) { 00494 Error("Rmdir", "Exception: %s", e.what()); 00495 return kFALSE; 00496 } 00497 00498 return kTRUE; 00499 } 00500 00501 00502 //______________________________________________________________________________ 00503 Bool_t TGLite::Register(const char *_lfn, const char *_turl , Long_t /*size*/, const char *_se, const char *_guid, Bool_t /*verbose*/) 00504 { 00505 // A File Catalog method, it creates a new LFC file in the name server and registering a replication. 00506 // INPUT: 00507 // _lfn [in] - a logical file name of the file to create. 00508 // _turl [in] - Storage File Name - is either the Site URL or 00509 // the Physical File Name for the replica. 00510 // _se [in] - either the Storage Element fully qualified hostname or the disk server. 00511 // _guid [in] - a GUID for the new file. 00512 // NOTE: 00513 // The other parameters are unsupported. 00514 // RETURN: 00515 // kTRUE if succeeded and kFALSE otherwise. 00516 00517 // Call for a Catalog manager 00518 CCatalogManager *pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00519 if (!pCatalog) 00520 return kFALSE; // TODO: Log me! 00521 00522 gaw_lfc_register reg; 00523 reg.m_file_name = _lfn; 00524 reg.m_guid = _guid; 00525 reg.m_SE_server = _se; 00526 reg.m_sfn = _turl; 00527 try { 00528 pCatalog->Run(reg); 00529 } catch (const exception &e) { 00530 Error("Register", "Exception: %s", e.what()); 00531 return kFALSE; 00532 } 00533 00534 return kTRUE; 00535 } 00536 00537 00538 //______________________________________________________________________________ 00539 Bool_t TGLite::Rm(const char *_lfn, Option_t* /*option*/, Bool_t /*verbose*/) 00540 { 00541 // A File Catalog method, it removes an LFC file entry from the name server. 00542 // The methods deletes all replicas from the file. 00543 // INPUT: 00544 // _lfn [in] - a logical name of the file to remove. 00545 // NOTE: 00546 // The other parameters are unsupported. 00547 // RETURN: 00548 // kTRUE if succeeded and kFALSE otherwise. 00549 00550 if (!_lfn) 00551 return kFALSE; 00552 00553 // Call for a Catalog manager 00554 // TODO: Implement "-f" option, which will force to remove all replicas from the file, 00555 // otherwise file will be deleted only if no replicas exist 00556 // Currently "-f" is by default. Now Rm deletes all file's replicas and the file itself from catalog namespace. 00557 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager()); 00558 if (!pCatalog) 00559 return kFALSE; // TODO: Log me! 00560 00561 gaw_lfc_rm rm; 00562 rm.m_file_name = _lfn; 00563 try { 00564 pCatalog->Run(rm); 00565 } catch (const exception &e) { 00566 Error("Rm", "Exception: %s", e.what()); 00567 return kFALSE; 00568 } 00569 00570 return kTRUE; 00571 } 00572 00573 00574 //______________________________________________________________________________ 00575 //--- Job Submission Interface 00576 TGridJob* TGLite::Submit(const char *_jdl) 00577 { 00578 // A Grid Job operations method, it processes a job submission. 00579 // INPUT: 00580 // _jdl [in] - a name of the job description file (JDL). The JDL file path can contain environment variables and a "~" (home) symbol. 00581 // RETURN: 00582 // a TGridJob object, which represents the newly submitted job. 00583 // The method returns NULL in case if an error occurred. 00584 00585 if (!_jdl) 00586 return NULL; // TODO: msg me! 00587 00588 try { 00589 // Call for a job submission 00590 CGLiteAPIWrapper::Instance().GetJobManager().DelegationCredential(); 00591 00592 string strVer; 00593 CGLiteAPIWrapper::Instance().GetJobManager().GetVersion(&strVer); 00594 Info("Submit", "GAW Job Manager uses WMProxy version: %s", strVer.c_str()); 00595 00596 string sJobID; 00597 CGLiteAPIWrapper::Instance().GetJobManager().JobSubmit(_jdl, &sJobID); 00598 Info("Submit", "Job successfully submitted. Job ID \"%s\"", sJobID.c_str()); 00599 return dynamic_cast<TGridJob*>(new TGLiteJob(sJobID.c_str())); 00600 } catch (const exception &e) { 00601 Error("Submit", "Exception: %s", e.what()); 00602 return NULL; 00603 } 00604 } 00605 00606 00607 //______________________________________________________________________________ 00608 TGridJDL* TGLite::GetJDLGenerator() 00609 { 00610 // Not implemented for RGLite. 00611 00612 MayNotUse("GetJDLGenerator"); 00613 return 0; 00614 } 00615 00616 00617 //______________________________________________________________________________ 00618 Bool_t TGLite::Kill(TGridJob *_gridjob) 00619 { 00620 // A Grid Job operations method, it cancels a given gLite job. 00621 // INPUT: 00622 // _gridjob [in] - a TGridJob object. 00623 // RETURN: 00624 // kTRUE if succeeded and kFALSE otherwise. 00625 00626 if (!_gridjob) 00627 return kFALSE; 00628 00629 return _gridjob->Cancel(); 00630 } 00631 00632 00633 //______________________________________________________________________________ 00634 Bool_t TGLite::KillById(TString _id) 00635 { 00636 // A Grid Job operations method, it cancels a gLite job by the given id. 00637 // INPUT: 00638 // _id [in] - a gLite job ID. 00639 // RETURN: 00640 // kTRUE if succeeded and kFALSE otherwise. 00641 00642 TGLiteJob gridjob(_id); 00643 return gridjob.Cancel(); 00644 }