CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
cudaPreallocate Namespace Reference

Functions

def main
 

Variables

tuple opts = parser.parse_args()
 
tuple parser
 

Function Documentation

def cudaPreallocate.main (   opts)

Definition at line 8 of file cudaPreallocate.py.

References join(), and print().

8 
9 def main(opts):
10  device = []
11  host = []
12 
13  device_re = re.compile("Device.*allocated new device block.*\((?P<bytes>\d+) bytes")
14  host_re = re.compile("Host.*allocated new host block.*\((?P<bytes>\d+) bytes")
15 
16  f = open(opts.file)
17  for line in f:
18  m = device_re.search(line)
19  if m:
20  device.append(m.group("bytes"))
21  continue
22  m = host_re.search(line)
23  if m:
24  host.append(m.group("bytes"))
25  f.close()
26 
27  print("process.CUDAService.allocator.devicePreallocate = cms.untracked.vuint32(%s)" % ",".join(device))
28  print("process.CUDAService.allocator.hostPreallocate = cms.untracked.vuint32(%s)" % ",".join(host))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

Variable Documentation

tuple cudaPreallocate.opts = parser.parse_args()

Definition at line 37 of file cudaPreallocate.py.

tuple cudaPreallocate.parser
Initial value:
1 = argparse.ArgumentParser(description="""Extract CUDAService preallocation parameters from a log file.To use, run the job once with "process.CUDAService.allocator.debug =
2 True" and direct the output to a file. Then run this script by passingthe file as an argument, and copy the output of this script back tothe configuration file.""")

Definition at line 30 of file cudaPreallocate.py.