CMS 3D CMS Logo

Classes | Functions
crabFunctions Namespace Reference

This module provides common functions for tasks with crab3. More...

Classes

class  CertInfo
 
class  CrabController
 The CrabController class. More...
 
class  CrabTask
 Class for a single CrabRequest e This class represents one crab3 task/request. More...
 
class  TaskStats
 Class holds job statistics for several Crab tasks. More...
 

Functions

def crabCommandProcess (q, crabCommandArgs)
 Function to run crab command in a new process. More...
 

Detailed Description

This module provides common functions for tasks with crab3.

This module provides common functions for tasks with crab3. You need no create a CrabController object in order to use the functions

Function Documentation

def crabFunctions.crabCommandProcess (   q,
  crabCommandArgs 
)

Function to run crab command in a new process.

Some CRAB commands (e.g. submit) create broken cmssw process objects when they are created in multiple calls of crabCommand via CRAB API Running them in a new process is a workaround, see https://twiki.cern.ch/twiki/bin/view/CMSPublic/CRAB3FAQ#Multiple_submission_fails_with_a

Definition at line 316 of file crabFunctions.py.

References edm.print().

316 def crabCommandProcess(q,crabCommandArgs):
317  # give crab3 the chance for one server glitch
318  i=0
319  while True:
320  i+=1
321  try:
322  res = crabCommand(*crabCommandArgs)
323  break
324  except HTTPException as e:
325  print("crab error ---------------")
326  print(e)
327  print("end error ---------------")
328  print("will try again!")
329  import time
330  time.sleep(5)
331  except CachefileNotFoundException as e:
332  print("crab error ---------------")
333  print(e)
334  print("end error ---------------")
335  print(crabCommandArgs)
336  res={ 'status':"CachefileNotFound",'jobs':{}}
337  break
338  if i>5:
339  res={ 'status':"UnexpectedError",'jobs':{}}
340  break
341  q.put( res )
342 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def crabCommandProcess(q, crabCommandArgs)
Function to run crab command in a new process.