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

add feature input_file

parent 05b682ab
Branches
No related tags found
No related merge requests found
......@@ -57,7 +57,6 @@ class JDLCreator(object):
# public attributes - user is allowed to change these values
###
print("asdfasdghrgasgoqhiohioht90!!!!!")
self.executable = executable
###
......@@ -68,6 +67,7 @@ class JDLCreator(object):
self._memory = 0
self._job_folder = job_folder
self._output_files = output_files
self._input_files = ""
self._remote_job = False
if len(extra_lines) > 0:
self._extra_lines = extra_lines
......@@ -272,6 +272,23 @@ class JDLCreator(object):
# type: (str) -> None
self._output_files = file_string
@property
def input_files(self):
# type: () -> str
"""Files or directories which should be transferred to workernode by HTCondor."""
return self._input_files
@input_files.setter
def input_files(self, file_string):
# type: (str) -> None
self._input_files = file_string
def SetInputFiles(self, file_string):
# type: (str) -> None
self._input_files = file_string
@property
def remote_job(self):
# type: () -> boolean
......@@ -325,7 +342,11 @@ class JDLCreator(object):
# do docker stuff for exe
jdl_content.append("executable = ./" + exe)
jdl_content.append("should_transfer_files = YES")
jdl_content.append("transfer_input_files = " + self.executable)
if self._input_files != "":
jdl_content.append("transfer_input_files = " + self.executable+','+self._input_files)
else:
jdl_content.append("transfer_input_files = " + self.executable)
else:
jdl_content.append("executable = " + exe)
......
#!/usr/bin/env python
from classes.JDLCreator import JDLCreator # import the class to create and submit JDL files
import numpy
def main():
jobs = JDLCreator() #run jobs on condocker cloude site
jobs.image = "ipython:v1_r26519_v01-01-07_r28283"
##################################
# submit job
##################################
jobs.SetExecutable("job.sh") # set job script
#build list of arguments
arguments=[]
for i in numpy.arange(0, 5,1):
arguments.append(i)
jobs.SetArguments(arguments) # set arguments
jobs.requirements= "(TARGET.PROVIDES_CPU == True) && (TARGET.PROVIDES_EKP_RESOURCES == True) && (TARGET.PROVIDES_BELLE_2 == True)"
jobs.wall_time = 1*60*60 # set walltime to 1h in sec
jobs.memory = 2048 # set memory to 2048 MB
jobs.SetFolder('condor_jobs/') # set folder
jobs.WriteJDL() # write an JDL file and create folder for log files
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment