Skip to content

Exercise 4b: Input Files As Arguments

In this exercise, the same executable is queued but the executable will use a different input file as an argument each time. These files are located in the ex04_folder.

The script reads the name of the file and opens it in order to ensure that the correct file was used.

#!/usr/bin/env python
import sys

input_filename = sys.argv[1]
print "The name of the file is ", input_filename

input_file = open(input_filename, 'r')
for line in input_file:
    print line

Create the submit description file exercise4b.sub by using the following:

    executable              =
    arguments               = $(file)
    output                  = $(file).$(ClusterId).$(ProcId).out
    error                   = $(file).$(ClusterId).$(ProcId).err
    log                     = $(file).$(ClusterId).log

    initialdir              = your_path/ex04_folder
    transfer_input_files    = $(file)

    queue 1

    queue 2

    queue 3

Execute condor_submit exercise4b.sub to submit the jobs.

Note: The jobs belong to the same Cluster and in different Processes because they use the same executable with different argument every time.