<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.na-mic.org/w/index.php?action=history&amp;feed=atom&amp;title=Engineering%3AProject%3ACondor_Job_Submission</id>
	<title>Engineering:Project:Condor Job Submission - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.na-mic.org/w/index.php?action=history&amp;feed=atom&amp;title=Engineering%3AProject%3ACondor_Job_Submission"/>
	<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Engineering:Project:Condor_Job_Submission&amp;action=history"/>
	<updated>2026-04-06T15:41:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Engineering:Project:Condor_Job_Submission&amp;diff=3685&amp;oldid=prev</id>
		<title>Andy: Update from Wiki</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Engineering:Project:Condor_Job_Submission&amp;diff=3685&amp;oldid=prev"/>
		<updated>2006-12-18T13:27:31Z</updated>

		<summary type="html">&lt;p&gt;Update from Wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''This Page Under Construction'''&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
Programmer's Week Project Material: [[Media:2005_UCSD_ProgrammingWeek-final.ppt|Project Summary Slide]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Compute Resources =&lt;br /&gt;
&lt;br /&gt;
A 32 node Compute Cluster has been made available to the NAMIC community during the Programmer's Week. Under Condor this allows for 64 available processors. We have set up a 'submit node' where you can log in and run jobs from. It is also possible to access data from the Birn Data Grid (SRB) for computational use, utilizing the proxy delegation method (i.e. you can delegate a user proxy to condor which will then delegate the proxy to the selected computational resources which will then be able to interact directly with the Data Grid). To obtain an account, please contact either Jason Gerk or Jeff Grethe during the Programmer's Week. Once you have a standard Unix account, you will SSH to the 'submit node' '''namic-srb.nbirn.net''' .&lt;br /&gt;
&lt;br /&gt;
= Remote Access to Data Grid via GSI Proxies =&lt;br /&gt;
&lt;br /&gt;
Once you login to the machine '''namic-srb.nbirn.net''' run the command '''birn-proxy-retrieve.pl''' .&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb jgerk]$ birn-proxy-retrieve.pl&lt;br /&gt;
 &lt;br /&gt;
  You are about to retrieve your BIRN proxy for authentication.&lt;br /&gt;
 &lt;br /&gt;
  Please enter your portal username.&lt;br /&gt;
  jgerk&lt;br /&gt;
  Please enter your portal passphrase to retrieve your proxy.&lt;br /&gt;
 &lt;br /&gt;
  You've successfully retrieved your BIRN proxy.&lt;br /&gt;
 &lt;br /&gt;
  Displayed below is your proxy information:&lt;br /&gt;
  -----------------------------------------------&lt;br /&gt;
  subject  : /C=US/O=BIRN/OU=UCSD - BIRN Coordinating Center/CN=Jason Gerk/USERID=jgerk/CN=proxy&lt;br /&gt;
  issuer   : /C=US/O=BIRN/OU=UCSD - BIRN Coordinating Center/CN=Jason Gerk/USERID=jgerk&lt;br /&gt;
  identity : /C=US/O=BIRN/OU=UCSD - BIRN Coordinating Center/CN=Jason Gerk/USERID=jgerk&lt;br /&gt;
  type     : full legacy globus proxy&lt;br /&gt;
  strength : 512 bits&lt;br /&gt;
  path     : /tmp/x509up_ujgerk&lt;br /&gt;
  timeleft : 11:59:59&lt;br /&gt;
  0&lt;br /&gt;
&lt;br /&gt;
This will retrieve your proxy and set up your environment in that shell and allow you to add Scommands into your shell script.&lt;br /&gt;
&lt;br /&gt;
= A Condor/SRB Example =&lt;br /&gt;
&lt;br /&gt;
Here is a working example. In my home directory I have a file called '''job_submit_file''' which contains the executable program (small shell script) the I want to be run when I launch the Condor job. This file is called '''getInfoSRB''', but you can name it anything.&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb birn_condor]$ more job_submit_file&lt;br /&gt;
 &lt;br /&gt;
  Executable                                 = getInfoSRB&lt;br /&gt;
  Universe                                   = vanilla&lt;br /&gt;
  Output                                     = output.stdout&lt;br /&gt;
  Error                                      = output.stderr&lt;br /&gt;
  Log                                        = output.log&lt;br /&gt;
  getenv                                     = TRUE&lt;br /&gt;
  should_transfer_files                      = YES&lt;br /&gt;
  when_to_transfer_output                    = ON_EXIT&lt;br /&gt;
  transfer_input_files                       = /tmp/x509up_u$ENV(LOGNAME)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Below is an example of what my shell script looks like. This will be run in the Compute Cluster environment, calling some Scommands, then pulling out the '''hello1''' program to a standard Linux environment where the permissions are changed and the file is run.&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb birn_condor]$ more getInfoSRB&lt;br /&gt;
  #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
  echo &amp;quot; &amp;quot;&lt;br /&gt;
  echo &amp;quot;This is an example of a shell script that uses Scommands.&amp;quot;&lt;br /&gt;
  echo &amp;quot; &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
  #  Run a Sls&lt;br /&gt;
  echo &amp;quot;Do and 'Sls' and show NAMIC related files:&amp;quot;&lt;br /&gt;
  Sls | grep -i namic&lt;br /&gt;
 &lt;br /&gt;
  #Get hello from SRB and download it locally on condor execute dir&lt;br /&gt;
  echo &amp;quot; &amp;quot;&lt;br /&gt;
  echo &amp;quot;Get a file from SRB: 'Sget hello' &amp;quot;&lt;br /&gt;
  Sget hello hello1&lt;br /&gt;
 &lt;br /&gt;
  #Run hello on condor execution machine&lt;br /&gt;
  echo &amp;quot; &amp;quot;&lt;br /&gt;
  echo &amp;quot;Set the permissions, and execute the program: chmod +x hello1 then ./hello1 &amp;quot;&lt;br /&gt;
  echo &amp;quot;(output below) &amp;quot;&lt;br /&gt;
  chmod +x hello1&lt;br /&gt;
  ./hello1&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Next, we are ready to launch the job. The '''job_submit_file''' calls the shell script which calls other programs within the Compute Cluster environment. Here we go.&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb birn_condor]$ birn_condor_submit job_submit_file&lt;br /&gt;
  Submitting job(s).&lt;br /&gt;
  Logging submit event(s).&lt;br /&gt;
  1 job(s) submitted to cluster 68.&lt;br /&gt;
&lt;br /&gt;
Once complete, a sucessful job should write to output.stdout (or whatever you defing in your submit file).&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb birn_condor]$ more output.stdout&lt;br /&gt;
 &lt;br /&gt;
  This is an example of a shell script that uses Scommands.&lt;br /&gt;
 &lt;br /&gt;
  Do and 'Sls' and show NAMIC related files:&lt;br /&gt;
  C-/home/jgerk.ucsd-bcc/namic&lt;br /&gt;
  C-/home/jgerk.ucsd-bcc/namic_backup&lt;br /&gt;
 &lt;br /&gt;
  Get a file from SRB: 'Sget hello'&lt;br /&gt;
 &lt;br /&gt;
  Set the permissions, and execute the program: chmod +x hello1 then ./hello1&lt;br /&gt;
  (output below)&lt;br /&gt;
  hello, Condor&lt;br /&gt;
&lt;br /&gt;
= Submitting A Condor Job =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; Submit template file focusing Condor with GSI and SRB. Replace YOUR_EXECUTALBE with the name of your executable, which will usually be a shell script with SRB commands and the executables you really want to run. add other input files to the end of transfer_input_files as needed for example /tmp/x509up_u$(LOGNAME), your_input1, your_input2, etc. Note that if you are using a shell script as your condor executable, you will have to either copy over your scientific code as an input file or store it in SRB and Sget it.&lt;br /&gt;
&lt;br /&gt;
== Template File ==&lt;br /&gt;
&lt;br /&gt;
 Executable                                 = YOUR_EXECUTABLE&lt;br /&gt;
 Universe                                   = vanilla&lt;br /&gt;
 Output                                     = YOUR_EXECUTABLE.stdout&lt;br /&gt;
 Error                                      = YOUR_EXECUTABLE.stderr&lt;br /&gt;
 Log                                        = YOUR_EXECUTABLE.log&lt;br /&gt;
 getenv                                     = TRUE&lt;br /&gt;
 should_transfer_files                      = YES&lt;br /&gt;
 when_to_transfer_output                    = ON_EXIT&lt;br /&gt;
 transfer_input_files                       = /tmp/x509up_u$ENV(LOGNAME)&lt;br /&gt;
 &lt;br /&gt;
 Queue&lt;br /&gt;
&lt;br /&gt;
= A NAMIC Example =&lt;br /&gt;
&lt;br /&gt;
Sample data and an associated executable from the NA-MIC svn Sandbox can be found [[Engineering:ITK_Grid_Pipeline|here]]&lt;br /&gt;
&lt;br /&gt;
In this example the sample data has been uploaded to a directory: /home/jegrethe.ucsd-bcc/TestData/NAMIC Results are written to: /home/jegrethe.ucsd-bcc/TestData/NAMIC_results&lt;br /&gt;
&lt;br /&gt;
The job submit file is as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;########################################################&lt;br /&gt;
  # Submit template file focusing Condor with GSI and SRB.&lt;br /&gt;
  # Replace YOUR_EXECUTALBE with the name of your executable,&lt;br /&gt;
  # which will usually be a shell script with SRB commands and&lt;br /&gt;
  # the executables you really want to run.  add other input files to&lt;br /&gt;
  # the end of transfer_input_files as needed for example /tmp/x509up_u$(USER,&lt;br /&gt;
  # your_input1, your_input2, etc.  Note that if you are using&lt;br /&gt;
  # a shell script as your condor executable, you will have to&lt;br /&gt;
  # either copy over your scientific code as an input file or&lt;br /&gt;
  # store it in SRB and Sget it.&lt;br /&gt;
 #######################################################&lt;br /&gt;
 &lt;br /&gt;
 Executable                                 = condorSH.sh&lt;br /&gt;
 Universe                                   = vanilla&lt;br /&gt;
 Output                                     = condorSH.stdout&lt;br /&gt;
 Error                                      = condorSH.stderr&lt;br /&gt;
 Log                                        = condorSH.log&lt;br /&gt;
 getenv                                     = TRUE&lt;br /&gt;
 should_transfer_files                      = YES&lt;br /&gt;
 when_to_transfer_output                    = ON_EXIT&lt;br /&gt;
 transfer_input_files                       = /tmp/x509up_ujegrethe&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The shell script executed on the condor compute node is as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 /usr/local/bin/Sget -r /home/jegrethe.ucsd-bcc/TestData/NAMIC&lt;br /&gt;
 &lt;br /&gt;
 cd NAMIC&lt;br /&gt;
 chmod a+x ./MultiModalityRigidRegistration&lt;br /&gt;
 ./MultiModalityRigidRegistration reg.nhdr mrt.nhdr xformIN xformOUT 2 1 &amp;gt;  reg.out&lt;br /&gt;
 &lt;br /&gt;
 cd ..&lt;br /&gt;
 mv NAMIC NAMIC_results&lt;br /&gt;
 /usr/local/bin/Sput -r NAMIC_results /home/jegrethe.ucsd-bcc/TestData&lt;br /&gt;
 &lt;br /&gt;
 /usr/local/bin/Sput condorSH.stderr /home/jegrethe.ucsd-bcc/TestData/NAMIC_results&lt;br /&gt;
 /usr/local/bin/Sput condorSH.stdout /home/jegrethe.ucsd-bcc/TestData/NAMIC_results&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condor log file for the job is as follows (Note: the log doesn't have any information on the SRB data movement, Condor only manages the movement of the proxy in this case):&lt;br /&gt;
&lt;br /&gt;
 000 (069.000.000) 06/17 01:40:08 Job submitted from host: &amp;lt;198.202.95.80:9646&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 001 (069.000.000) 06/17 01:40:13 Job executing on host: &amp;lt;198.202.95.110:9607&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 006 (069.000.000) 06/17 01:40:21 Image size of job updated: 35248&lt;br /&gt;
 ...&lt;br /&gt;
 006 (069.000.000) 06/17 02:00:21 Image size of job updated: 93844&lt;br /&gt;
 ...&lt;br /&gt;
 005 (069.000.000) 06/17 03:06:38 Job terminated.&lt;br /&gt;
        (1) Normal termination (return value 0)&lt;br /&gt;
                Usr 0 01:26:00, Sys 0 00:00:00  -  Run Remote Usage&lt;br /&gt;
                Usr 0 00:00:00, Sys 0 00:00:00  -  Run Local Usage&lt;br /&gt;
                Usr 0 01:26:00, Sys 0 00:00:00  -  Total Remote Usage&lt;br /&gt;
                Usr 0 00:00:00, Sys 0 00:00:00  -  Total Local Usage&lt;br /&gt;
        0  -  Run Bytes Sent By Job&lt;br /&gt;
        3489  -  Run Bytes Received By Job&lt;br /&gt;
        0  -  Total Bytes Sent By Job&lt;br /&gt;
        3489  -  Total Bytes Received By Job&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
= Condor Quick Help and Useful Commands =&lt;br /&gt;
&lt;br /&gt;
To see what resources are available on the cluster: '''condor_status'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb jgerk]$ condor_status&lt;br /&gt;
 &lt;br /&gt;
  Name          OpSys       Arch   State      Activity   LoadAv Mem   ActvtyTime&lt;br /&gt;
 &lt;br /&gt;
  vm1@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:03&lt;br /&gt;
  vm2@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:03&lt;br /&gt;
  vm1@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:03&lt;br /&gt;
  vm2@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:04&lt;br /&gt;
  vm1@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:03&lt;br /&gt;
  vm2@birn-clus LINUX       INTEL  Unclaimed  Idle       0.000  1979  0+00:00:05&lt;br /&gt;
  vm1@birn-clus LINUX       INTEL  Claimed    Busy       0.000  1979  0+00:00:04&lt;br /&gt;
  vm2@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:06&lt;br /&gt;
  vm1@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:03&lt;br /&gt;
  vm2@birn-clus LINUX       INTEL  Claimed    Idle       0.000  1979  0+00:00:03&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                     Machines Owner Claimed Unclaimed Matched Preempting&lt;br /&gt;
 &lt;br /&gt;
         INTEL/LINUX       62     0      61         1       0          0&lt;br /&gt;
 &lt;br /&gt;
               Total       62     0      61         1       0          0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; To launch a job using a submit file: '''birn_condor_submit &amp;lt;job_submit_file&amp;gt;'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 [jgerk@namic-srb birn_condor]$ birn_condor_submit job_submit_file&lt;br /&gt;
 Submitting job(s).&lt;br /&gt;
 Logging submit event(s).&lt;br /&gt;
 1 job(s) submitted to cluster 68.&lt;br /&gt;
&lt;br /&gt;
To see what is queued to be run: '''condor_q'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb birn_condor]$ condor_q&lt;br /&gt;
 &lt;br /&gt;
  -- Submitter: namic-srb.public : &amp;lt;132.239.132.232:9663&amp;gt; : namic-srb.public&lt;br /&gt;
  ID      OWNER            SUBMITTED     RUN_TIME ST PRI SIZE CMD&lt;br /&gt;
  67.0   jgerk           6/27 04:02   0+00:03:53 R  0   0.0  getInfoSRB&lt;br /&gt;
 &lt;br /&gt;
  1 jobs; 0 idle, 1 running, 0 held&lt;br /&gt;
&lt;br /&gt;
To remove a job from the queue: '''condor_rm &amp;lt;job_id&amp;gt;'''&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [jgerk@namic-srb birn_condor]$ condor_rm 67.0&lt;br /&gt;
  Job 67.0 marked for removal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Syntax Strawman =&lt;br /&gt;
&lt;br /&gt;
 namic-submit [--save-submit-file &amp;lt;submitfile&amp;gt;] [--job-directory &amp;lt;jobdir&amp;gt;] &amp;lt;cmd&amp;gt; [&amp;lt;args&amp;gt;...]&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
* ''submitfile'' is a condor job submit file; if not specified a temp file is generated&lt;br /&gt;
* ''jobdir'' is a working state directory for a set of submissions that you want to later observe with namic-wait or manually inspect&lt;br /&gt;
* ''cmd'' is a shell script or executable that can be run on the remote environment&lt;br /&gt;
* ''args'' are arguments to the cmd&lt;br /&gt;
&lt;br /&gt;
functionality: namic-submit takes the given command and args and runs the job on a condor-determined external compute node. By default stdin, stdout, and stderr of the ''cmd'' are mapped to the corresponding files of namic-submit.&lt;br /&gt;
&lt;br /&gt;
If srb proxy is not set up, namic-submit prompts you for srb user id and password and sets up proxy.&lt;br /&gt;
&lt;br /&gt;
 namic-wait [--job-directory &amp;lt;jobdir&amp;gt;] [&amp;lt;groupid&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&lt;br /&gt;
* ''jobdir'' is a directory that corresponds to the state for jobs submitted by namic-submit&lt;br /&gt;
&lt;br /&gt;
functionality: namic-wait blocks until all jobs submitted with the given groupid have completed running&lt;/div&gt;</summary>
		<author><name>Andy</name></author>
		
	</entry>
</feed>