Grid

The Grid module contains several utilities for grid operations

DIRAC.Core.Utilities.Grid.executeGridCommand(proxy, cmd, gridEnvScript=None)

Execute cmd tuple after sourcing GridEnv

DIRAC.Core.Utilities.Grid.getBdiiCEInfo(vo, host=None, glue2=False)

Get information for all the CEs/queues for a given VO

Parameters:
  • vo (str) – BDII VO name
  • host (str) – url to query for information
  • glue2 (bool) – if True query the GLUE2 information schema
Returns:

result structure: result[‘Value’][siteID][‘CEs’][ceID][‘Queues’][queueName]. For each siteID, ceID, queueName all the BDII/Glue parameters are retrieved

DIRAC.Core.Utilities.Grid.getBdiiSEInfo(vo, host=None)

Get information for all the SEs for a given VO

Parameters:vo – BDII VO name
Return result structure:
 result[‘Value’][siteID][‘SEs’][seID]. For each siteID, seIDall the BDII/Glue SE/SA parameters are retrieved
DIRAC.Core.Utilities.Grid.ldapCE(ce, attr=None, host=None)

CE (really SubCluster in definition of bdii) information from bdii. It contains by the way host information for ce.

Parameters:ce – ce or part of it with globing, for example, “ce0?.tier2.hep.manchester*”
Returns:standard DIRAC answer with Value equals to list of clusters.

Each cluster is dictionary which contains attributes of ce. For example result[‘Value’][0][‘GlueHostBenchmarkSI00’]

DIRAC.Core.Utilities.Grid.ldapCEState(ce, vo, attr=None, host=None)

CEState information from bdii. Only CE with CEAccessControlBaseRule=VO:lhcb are selected.

Parameters:ce – ce or part of it with globing, for example, “ce0?.tier2.hep.manchester*”
Returns:standard DIRAC answer with Value equals to list of ceStates.

Each ceState is dictionary which contains attributes of ce. For example result[‘Value’][0][‘GlueCEStateStatus’]

DIRAC.Core.Utilities.Grid.ldapCEVOView(ce, vo, attr=None, host=None)

CEVOView information from bdii. Only CE with CEAccessControlBaseRule=VO:lhcb are selected.

Parameters:ce – ce or part of it with globing, for example, “ce0?.tier2.hep.manchester*”
Returns:standard DIRAC answer with Value equals to list of ceVOViews.

Each ceVOView is dictionary which contains attributes of ce. For example result[‘Value’][0][‘GlueCEStateRunningJobs’]

DIRAC.Core.Utilities.Grid.ldapCluster(ce, attr=None, host=None)

CE (really SubCluster in definition of bdii) information from bdii. It contains by the way host information for ce.

Parameters:ce – ce or part of it with globing, for example, “ce0?.tier2.hep.manchester*”
Returns:standard DIRAC answer with Value equals to list of clusters.

Each cluster is dictionary which contains attributes of ce. For example result[‘Value’][0][‘GlueHostBenchmarkSI00’]

DIRAC.Core.Utilities.Grid.ldapSE(site, vo, attr=None, host=None)

SE/SA information from bdii.

Parameters:
  • site – site with globing, for example, “ce0?.tier2.hep.manchester*” or just “*”
  • vo – VO name with globing, “*” if all VOs
Returns:

standard DIRAC answer with Value equals to list of SE/SA merged items.

Each SE is dictionary which contains attributes of SE and corresponding SA. For example result[‘Value’][0][‘GlueSESizeFree’]

DIRAC.Core.Utilities.Grid.ldapSEAccessProtocol(se, attr=None, host=None)

SE access protocol information from bdii

Parameters:se – se or part of it with globing, for example, “ce0?.tier2.hep.manchester*”
Returns:standard DIRAC answer with Value equals to list of access protocols.
DIRAC.Core.Utilities.Grid.ldapSEVOInfo(vo, seID, attr=['GlueVOInfoPath', 'GlueVOInfoAccessControlBaseRule'], host=None)

VOInfo for a given SE

DIRAC.Core.Utilities.Grid.ldapService(serviceID='*', serviceType='*', vo='*', attr=None, host=None)

Service BDII info for a given VO

Parameters:service – service type, e.g. SRM
Returns:standard DIRAC answer with Value equals to list of services
DIRAC.Core.Utilities.Grid.ldapSite(site, attr=None, host=None)

Site information from bdii.

Parameters:site – Site as it defined in GOCDB or part of it with globing, for example: UKI-*
Returns:standard DIRAC answer with Value equals to list of sites.

Each site is dictionary which contains attributes of site. For example result[‘Value’][0][‘GlueSiteLocation’]

DIRAC.Core.Utilities.Grid.ldapsearchBDII(filt=None, attr=None, host=None, base=None, selectionString='Glue')

Python wrapper for ldapserch at bdii.

Parameters:
  • filt – Filter used to search ldap, default = ‘’, means select all
  • attr – Attributes returned by ldapsearch, default = ‘*’, means return all
  • host – Host used for ldapsearch, default = ‘lcg-bdii.cern.ch:2170’, can be changed by $LCG_GFAL_INFOSYS
Returns:

standard DIRAC answer with Value equals to list of ldapsearch responses

Each element of list is dictionary with keys:

‘dn’: Distinguished name of ldapsearch response ‘objectClass’: List of classes in response ‘attr’: Dictionary of attributes