How to submmit jobs using Condor_G

Condor is a batch system, while Condor_G acts as job manager in grid environment. Condor can be used to submmit many types of jobs, such as MPI,Java and etc. The following is a sample that I used in osg.cnic.cn.

 

 

test.cmd

*********************************************

universe=globus

# You will probably want to change the following line to point to
# some remote site that supports your VO
GlobusScheduler=osg.cnic.cn:/jobmanager-condor

# You will certainly want to change the following line to point
# to the executable you want to run on the OSG.  /usr/bin/env is useful for
# testing the submission process, but that's about it.
executable=thread2
# If your executable originates from your submission machine rather than
# being guaranteed to be available on the destination, you need to uncomment:
# transfer_input_files = True
#requirements = Arch == "X86_64" && OpSys == "Linux"

requirements = (Arch == "IA64")&&(Name == "slot3@c2402")

# These attributes should be False in general for GRID operations
stream_output = False
stream_error  = False

# This makes the standard output of your program end up in the local file
# named test1.out.  Any additional output files your job creates will be detected
# and returned to the submitting directory.

# Standard output from your job.
output = test1.out

# Standard error from your job
error  = test1.err

# Condor messages related to the scheduling and execution of your job.
log    = test1.log

# Generic directives
#
# maxWallTime in minutes is advisable because some sites have short default times
# if this is not specified.
#
# JobType is advisable because on many sites where the underlying batch manager is
# of the PBS flavor default to the "multiple" type. Note the escaping of the
# quotes on the string value for the quantity. For a full description of RSL, see
# http://www.globus.org/toolkit/docs/2.4/gram/rsl_spec1.html
globusrsl = (maxWallTime=14400)(JobType=/"single/")

# The following line must be last in the file.  The order of the other
# lines does not matter.
queue
********************************************************

 

 

mulThread2

********************************************************

 

#include <pthread.h>
#include <iostream>
#include <ctime>
#include <stdlib.h>
using namespace std;

void* tprocess1(void* duration){
         int i=0;
        int * DURATION=(int *)duration;
         //int DURATION = 2*24*3600;
         //int DURATION = 2*3600;
        //int DURATION = 60;
         time_t startTime = time(NULL);

         while(1){
           i++;
           if(time(NULL)-startTime>*DURATION) {
             break;
           }
         }
         return NULL;
}

void* tprocess2(void* args){
         while(1){
                 cout << "tprocess2" << endl;
         }
         return NULL;
}

int main(int argc,char* argv[]){

   int duration=atoi(argv[1]);
    int thread_num=atoi(argv[2]);

    int NUM = 100;
    pthread_t t[NUM];

    for(int i=0;i<thread_num;i++){
       pthread_create(&t[i],NULL,tprocess1,&duration);
    }

    pthread_join(t[1],NULL);
    return 0;
}

 

 

****************************************************

 

g++ mulThread2.cpp -othread2 -lpthread
 

 

condor_submmit  test.cmd

 

condor_q

 

tail -f test1.log

 

[zhxue@osg CPlusPlus]$ ps H -eo user,pid,ppid,tid,time,%cpu,cmd --sort=%cpu |grep zhxue
zhxue     8829  8828  8829 00:00:00  0.0 condor_exec.exe
root     13180 13115 13180 00:00:00  0.0 su zhxue
zhxue    15827 13181 15827 00:00:00  0.0 ps H -eo user,pid,ppid,tid,time,%cpu,cmd --sort=%cpu
zhxue    15828 13181 15828 00:00:00  0.0 grep zhxue
zhxue    13181 13180 13181 00:00:00  0.0 bash
zhxue     7386  7374  7386 00:00:00  0.0 perl /home/zhxue/.globus/.gass_cache/local/md5/ca/671e98ba9d9c08841922dd3d5fd136/md5/ff/fc302da2cdfe216b4c7869739d6649/data --dest-url=https://osg.cnic.cn:49001/tmp/condor_g_scratch.0x9007e10.5089/grid-monitor.osg.cnic.cn:2119.1/grid-monitor-job-status
zhxue     8827  5089  8827 00:00:00  0.0 condor_shadow -f 6297.0 --schedd=<159.226.3.188:55200> --xfer-queue=limit=upload,download;addr=<159.226.3.188:60044> <159.226.3.188:60044> -
zhxue     6836  5089  6836 00:00:00  0.0 condor_gridmanager -f -C (Owner=?="zhxue"&&JobUniverse==9) -o zhxue -S /tmp/condor_g_scratch.0x9007e10.5089
zhxue     7222     1  7222 00:00:00  0.0 globus-job-manager -conf /opt/osg-1.0.1/globus/etc/globus-job-manager.conf -type managedfork -rdn jobmanager-managedfork -machine-type unknown -publish-jobs
zhxue     7417  7386  7417 00:00:00  0.0 perl /tmp/grid_manager_monitor_agent.zhxue.7386.1000 --delete-self --maxtime=3600s
zhxue     6839  6836  6839 00:00:00  0.0 /opt/osg-1.0.1/condor/sbin/gahp_server
zhxue     8829  8828  8832 00:17:46 97.5 condor_exec.exe
zhxue     8829  8828  8834 00:17:49 97.8 condor_exec.exe
zhxue     8829  8828  8833 00:17:49 97.8 condor_exec.exe
zhxue     8829  8828  8835 00:17:51 98.0 condor_exec.exe
zhxue     8829  8828  8831 00:17:52 98.1 condor_exec.exe
zhxue     8829  8828  8830 00:17:52 98.1 condor_exec.exe

 

 

 

The following available example is from condor manual

 

 

 executable = hi
universe = grid
grid_resource = gt2 modi4.ncsa.uiuc.edu/jobmanager  //gt2 osg.cnic.cn/jobmanager
output = test.out
log = test.log
queue

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值