
import os
import sys
import cPickle as pickle

def main():
    """
    Application entry point.
    """

    # make the job identifier obvious
    process_number  = int(os.environ["CONDOR_PROCESS"])
    cluster_number  = int(os.environ["CONDOR_CLUSTER"])
    identifier_path = "JOB_IS_%i.%i" % (cluster_number, process_number)

    open(identifier_path, "w").close()

    # load and run the job
    job = pickle.load(sys.stdin)

    job.run()

if __name__ == "__main__":
    main()



import os
import sys
import cPickle as pickle

def main():
    """
    Application entry point.
    """

    # make the job identifier obvious
    process_number  = int(os.environ["CONDOR_PROCESS"])
    cluster_number  = int(os.environ["CONDOR_CLUSTER"])
    identifier_path = "JOB_IS_%i.%i" % (cluster_number, process_number)

    open(identifier_path, "w").close()

    # load and run the job
    with open("job.pickle") as job_file:
        job = pickle.load(job_file)

    job.run()

if __name__ == "__main__":
    main()


Load job from a job file instead of stdin.
Load job from a job file instead of stdin.

  
  import os
  import sys
  import cPickle as pickle
  
  def main():
      """
      Application entry point.
      """
  
      # make the job identifier obvious
      process_number  = int(os.environ["CONDOR_PROCESS"])
      cluster_number  = int(os.environ["CONDOR_CLUSTER"])
      identifier_path = "JOB_IS_%i.%i" % (cluster_number, process_number)
  
      open(identifier_path, "w").close()
  
      # load and run the job
-     job = pickle.load(sys.stdin)
+     with open("job.pickle") as job_file:
+         job = pickle.load(job_file)
  
      job.run()
  
  if __name__ == "__main__":
      main()
  
  
Load job from a job file instead of stdin.
## Code Before:

import os
import sys
import cPickle as pickle

def main():
    """
    Application entry point.
    """

    # make the job identifier obvious
    process_number  = int(os.environ["CONDOR_PROCESS"])
    cluster_number  = int(os.environ["CONDOR_CLUSTER"])
    identifier_path = "JOB_IS_%i.%i" % (cluster_number, process_number)

    open(identifier_path, "w").close()

    # load and run the job
    job = pickle.load(sys.stdin)

    job.run()

if __name__ == "__main__":
    main()


## Instruction:
Load job from a job file instead of stdin.
## Code After:

import os
import sys
import cPickle as pickle

def main():
    """
    Application entry point.
    """

    # make the job identifier obvious
    process_number  = int(os.environ["CONDOR_PROCESS"])
    cluster_number  = int(os.environ["CONDOR_CLUSTER"])
    identifier_path = "JOB_IS_%i.%i" % (cluster_number, process_number)

    open(identifier_path, "w").close()

    # load and run the job
    with open("job.pickle") as job_file:
        job = pickle.load(job_file)

    job.run()

if __name__ == "__main__":
    main()

