Skip to content
Snippets Groups Projects
Commit 97ed8c45 authored by Matthias Schnepf's avatar Matthias Schnepf
Browse files

add disk space

parent 6147b282
Branches
No related tags found
No related merge requests found
...@@ -65,6 +65,7 @@ class JDLCreator(object): ...@@ -65,6 +65,7 @@ class JDLCreator(object):
self._cloud_site = CloudSite(site_name.lower()) self._cloud_site = CloudSite(site_name.lower())
self._wall_time = int(wall_time) self._wall_time = int(wall_time)
self._memory = 0 self._memory = 0
self._disk_space = 0
self._job_folder = job_folder self._job_folder = job_folder
self._output_files = [] self._output_files = []
self._input_files = [] self._input_files = []
...@@ -214,6 +215,23 @@ class JDLCreator(object): ...@@ -214,6 +215,23 @@ class JDLCreator(object):
"""Set requested number of cores""" """Set requested number of cores"""
self.cpus = cpus_ self.cpus = cpus_
@property
def disk_space(self):
"""Requested disk space in MB"""
return self._disk_space
@memory.setter
def disk_space(self, disk_space_):
# type: (int) -> None
"""Expected maximum disk_space (upper limit) in MB"""
self._disk_space = disk_space_
def SetMemory(self, disk_space_):
# type: (int) -> None
"""Expected maximum disk space (upper limit) in MB"""
self.memory = disk_space_
@property @property
def accounting_group(self): def accounting_group(self):
"""Get accounting group""" """Get accounting group"""
...@@ -461,6 +479,9 @@ class JDLCreator(object): ...@@ -461,6 +479,9 @@ class JDLCreator(object):
if self._cpus > 1: if self._cpus > 1:
jdl_content.append('request_cpus = %d' % self._cpus) jdl_content.append('request_cpus = %d' % self._cpus)
if self._disk_space > 0:
jdl_content.append('request_disk = %d' % (1024 * self._disk_space))
# add accounting group, if set # add accounting group, if set
if self._accounting_group is not "": if self._accounting_group is not "":
jdl_content.append('accounting_group = %s' % self._accounting_group) jdl_content.append('accounting_group = %s' % self._accounting_group)
......
...@@ -15,6 +15,7 @@ def main(): ...@@ -15,6 +15,7 @@ def main():
jobs.executable = "job.sh" # name of the job script jobs.executable = "job.sh" # name of the job script
jobs.wall_time = 10 * 60 * 60 # job will finish in 10 hours jobs.wall_time = 10 * 60 * 60 # job will finish in 10 hours
jobs.memory = 2048 # Our regular 2 GB per core jobs.memory = 2048 # Our regular 2 GB per core
jobs.disk_space = 200
# build list of arguments: 1,2,3,4,5 # build list of arguments: 1,2,3,4,5
arguments = [x for x in range(0, 5)] arguments = [x for x in range(0, 5)]
...@@ -23,7 +24,7 @@ def main(): ...@@ -23,7 +24,7 @@ def main():
jobs.arguments = arguments # set arguments for condor job jobs.arguments = arguments # set arguments for condor job
# Our job requires lots of CPU resources and needs access to the local EKP resources # Our job requires lots of CPU resources and needs access to the local EKP resources
jobs.requirements = "(Target.PROVIDES_CPU ==True) && (TARGET.PROVIDES_EKP_RESOURCES == True)" jobs.requirements = "(Target.ProvidesCPU ==True) && (TARGET.ProvidesEKPResources == True)"
jobs.job_folder = "condor_jobs" # set name of the folder, where files and information are stored jobs.job_folder = "condor_jobs" # set name of the folder, where files and information are stored
jobs.WriteJDL() # write an JDL file and create folder for log files jobs.WriteJDL() # write an JDL file and create folder for log files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment